Learn R Programming

EGRET (version 2.3.0)

readUserSample: Import user 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 combinded with interval censoring, additional columns can be inserted, each starting with remark code (specifically looking for

Usage

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

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
interactive
logical Option for interactive mode. If true, there is user interaction for error handling and data checks.

Value

  • A data frame 'Sample' with the following columns: lll{ Name Type Description Date Date Date ConcLow numeric Lower limit of concentration ConcHigh numeric Upper limit of concentration Uncen integer Uncensored data (1=TRUE, 0=FALSE) ConcAve numeric Average concentration Julian integer Number of days since Jan. 1, 1850 Month integer Month of the year [1-12] Day integer Day of the year [1-366] DecYear numeric Decimal year MonthSeq integer Number of months since January 1, 1850 SinDY numeric Sine of the DecYear CosDY numeric Cosine of the DecYear }

See Also

compressData, populateSampleColumns

Examples

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

Run the code above in your browser using DataLab