load.ts {rLakeAnalyzer} | R Documentation |
Load timeseries from properly formatted text file.
Description
A convenience function to load timeseries data into R based on the standardized format used by Lake Analyzer.
Timeseries files must follow a common format. The first column must have the label 'datetime' and be of the format yyyy-mm-dd HH:MM:SS (ISO 8601 without the "T" delimiter). The second can be skipped if not using sub-minute data.
Usage
load.ts(fPath, tz = "GMT")
Arguments
fPath |
The file path as a string. |
tz |
Timezone string to be supplied to |
Value
A data frame in the required format for use with other rLakeAnalyzer timeseries functions.
See Also
For dataloading ts.meta.depths
,
For analyzing
timeseries data, see ts.meta.depths
,
ts.thermo.depth
, ts.schmidt.stability
,
ts.lake.number
.
Examples
#Get the path for the package example file included
exampleFilePath <- system.file('extdata', 'Sparkling.wtr', package="rLakeAnalyzer")
#Load
sparkling.temp = load.ts(exampleFilePath)
#calculate and plot the thermocline depth
t.d = ts.thermo.depth(sparkling.temp)
plot(t.d$datetime, t.d$thermo.depth, type='l', ylab='Thermocline Depth (m)', xlab='Date')