Learn R Programming

EGRET (version 3.0.7)

readUserSample: Import user-supplied sample data for EGRET analysis

Description

Imports data from a user-supplied file, and converts it to a Sample data frame (including summing multiple constituents), appropriate for EGRET analysis. First column is date, second is remark code, and third is value. If multiple constituents are to be combined with interval censoring, additional pairs of columns can be inserted, each pair starting with remark code (specifically looking for <), followed by the values.

Usage

readUserSample(filePath, fileName, hasHeader = TRUE, separator = ",",
  verbose = TRUE, interactive = NULL)

Value

A data frame 'Sample' with the following columns:

NameTypeDescription
DateDateDate
ConcLownumericLower limit of concentration
ConcHighnumericUpper limit of concentration
UncenintegerUncensored data (1=TRUE, 0=FALSE)
ConcAvenumericAverage concentration
JulianintegerNumber of days since Jan. 1, 1850
MonthintegerMonth of the year [1-12]
DayintegerDay of the year [1-366]
DecYearnumericDecimal year
MonthSeqintegerNumber of months since January 1, 1850
SinDYnumericSine of the DecYear
CosDYnumericCosine of the DecYear

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. , default is "," which is separator used in a .csv file.

verbose

logical specifying whether or not to display progress message

interactive

logical deprecated. Use 'verbose' instead

See Also

compressData, populateSampleColumns

Examples

Run this code
filePath <- system.file("extdata", package="EGRET")
fileName <- 'ChoptankRiverNitrate.csv'
Sample <- readUserSample(filePath,fileName, separator=";",verbose=FALSE)

Run the code above in your browser using DataLab