readDataFromFile | R Documentation |
Imports data from user-supplied data file. Specifically used to import water flow data for use in the EGRET package. For EGRET usage, the first column is expected to be dates. If the data is daily data, then next column is expected to be the measured values. If the data is sampled data, the next column is remark codes, and the third column is values. If the date format is not automatically detected, the format can be specified using the "format" argument.
readDataFromFile(filePath, fileName, hasHeader = TRUE, separator = ",",
format = "%m/%d/%Y")
filePath |
character specifying the path to the file. If it is in the working directory, use ".". |
fileName |
character name of file to open. |
hasHeader |
logical true if the first row of data is the column headers |
separator |
character character that separates data cells. The default is "," for a csv file. Tab delimited would be "\t". |
format |
character indicating the format of the date (which should
be in the first column). Default is "%m\/%d/%Y". See |
retval dataframe with dateTime, value, and code columns
filePath <- system.file("extdata", package="EGRET")
fileName <- 'ChoptankRiverFlow.txt'
ChopData <- readDataFromFile(filePath,fileName, separator="\t")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.