importCSV: Import Files

View source: R/importCSV.R

importCSVR Documentation

Import Files

Description

Imports a comma-separated variable file to a data frame.

Usage

importCSV(file.name = "", tz = "")

Arguments

file.name

a character string specifying the name of the comma-separated variable (CSV) file containing the data to be imported; importCSV requires file.name to be a readable file on the computer.

tz

a character string indicating the time-zone information for data imported as "POSIXct." The default is to use the local setting.

Details

All of the dates in a date column must have the same format as the first non-blank date in the column. Any date with a format different from that of the first non-blank date in the column will be imported as NA (missing value). Dates imported as class "Date" using a 4-digit year, 2-digit month, and 2-digit day with the period (.), hyphen (-), slash (/), or no separator. Time and date data are imported as class "POSIXct" and assumes the standard POSIX format for date and time.

Value

A data frame with one column for each data column in the CSV file.

Note

A NULL data frame is created if there are no data in the file.

See Also

read.csv, read.table, scan, as.Date, as.POSIXct

Examples

## Not run: 
## These datasets are available in smwrData as text files
TestDir <- system.file("misc", package="smwrData")
TestPart <- importCSV(file.path(TestDir, "TestPart.csv"))

## End(Not run)

USGS-R/smwrBase documentation built on Oct. 18, 2022, 9:55 a.m.