readCampbell | R Documentation |
Reads a datafile produced by Campbell Scientific dataloggers into a CRHMr data frame. Both old (multiple table, no header) and new (single table, with header) data files can be read in.
readCampbell(
campbellFile,
missingValue = -6999,
timezone = "",
quiet = TRUE,
logfile = ""
)
campbellFile |
Required. The name of the file containing the Campbell Scientific datalogger output. |
missingValue |
Optional. Default is -6999. All values less than or equal to this will be set to be |
timezone |
Required. The name of the timezone of the data as a character string. This should be the timezone of your data, but omitting daylight savings time. Note that the timezone code is specific to your OS. To avoid problems, you should use a timezone without daylight savings time. Under Linux, you can use CST and MST for Central Standard or Mountain Standard time, respectively. Under Windows or OSX, you can use etc/GMT+6 or etc/GMT+7 for Central Standard and Mountain Standard time. DO NOT use America/Regina as the time zone, as it includes historical changes between standard and daylight savings time. |
quiet |
Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If unsuccessful, returns FALSE
. If successful, returns a CRHMr data frame. If there are two tables in the campbellFile, then they are returned as a list.
If the campbellFile does not contain headers, then the variable names will be assigned by R
. In any case, you will probably want to rename the variables using the command names()
.
Kevin Shook
readObsFile
readExportFile
readOutputFile
## Not run:
# read in an old format Campbell file
oldformatdata <- readCampbell('OldDataLogger.dat', timezone='MST')
# now extract the data frames from the returned list
obs1 <- oldfomatdata[[1]]
obs2 <- oldformatdata[[2]]
# read in a new format Campbell file
obs3 <- readCampbell('BowHut_Fifteen.dat', timezone='MST')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.