Learn R Programming

dataRetrieval (version 1.4.0)

getDataFromFile: 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 WRTDS package. For WRTDS usage, the first column is expected to be dates, the second column measured values. The third column is optional, it contains any remark codes.

Usage

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

Arguments

filePath

string specifying the path to the file

fileName

string name of file to open

hasHeader

logical true if the first row of data is the column headers

separator

string character that separates data cells

Value

retval dataframe with dateTime, value, and code columns

Examples

Run this code
# NOT RUN {
# Examples of how to use getDataFromFile:
# Change the file path and file name to something meaningful:
filePath <- system.file("extdata", package="dataRetrieval")
filePath <- paste(filePath,"/",sep="")
fileName <- 'ChoptankRiverFlow.txt'
ChopData <- getDataFromFile(filePath,fileName, separator="\t")
# }

Run the code above in your browser using DataLab