Learn R Programming

EGRET (version 2.3.0)

readDataFromFile: Basic Data Import for Water Flow Data

Description

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.

Usage

readDataFromFile(filePath, fileName, hasHeader = TRUE, separator = ",")

Arguments

filePath
character specifying the path to the file
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

Value

  • retval dataframe with dateTime, value, and code columns

Examples

Run this code
filePath <- system.file("extdata", package="EGRET")
fileName <- 'ChoptankRiverFlow.txt'
ChopData <- readDataFromFile(filePath,fileName, separator="\t")

Run the code above in your browser using DataLab