importRDB | R Documentation |
Imports a formatted, tab-delimited file to a data frame.
importRDB(file.name = "", date.format = NULL, tz = "", convert.type = TRUE)
file.name |
a character string specifying the name of the relational database (RDB) file containing the data to be imported. |
date.format |
a character string specifying the format of all date
columns. Required for columns that contain date and time. The default value,
|
tz |
the time zone information of the data. |
convert.type |
logical |
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). By default, dates are imported as class "Date" using a 4-digit year,
2-digit month, and 2-digit day with the period (.), hyphen (-), slash (/), or
no separator.
If a valid date.format
is supplied, then the data are imported using
as.POSIXct
, and time information can be included in the data. If
date.format
is "none," then conversion of the date information is
suppressed and the data are retained as character strings.
The value for tz
should be a valid "Olson" format consisting typically
of a continent and city. See timezone
for a description of
time zones. For the United States, use these time-zone specifications where
daylight savings time is used:
Eastern | "America/New_York" |
Central | "America/Chicago" |
Mountain | "America/Denver" |
Pacific | "America/Los_Angeles" |
Alaska | "America/Anchorage" |
Hawii | "America/Honolulu" |
Use these time specifications where daylight savings time is not used: #'
Eastern | "America/Jamaica" |
Central | "America/Managua" |
Mountain | "America/Phoenix" |
Pacific | "America/Metlakatla" |
A data frame with one column for each data column in the RDB file.
A NULL data frame is created if there are no data in the file.
The header information contained in the RDB file is retained in the output
dataset as comment
.
If convert.type
is TRUE
, then non-numeric values, other than blanks,
are converted to NaN
(not a number) rather than NA
(missing value)
in numeric columns. NaN
values are treated like NA
values but can
be identified using the is.nan
function.
read.table
, as.Date
, as.POSIXct
,
comment
## Not run: ## This dataset is available in smwrData as a text file TestDir <- system.file("misc", package="smwrData") TestFull <- importRDB(file.path(TestDir, "TestFull.rdb")) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.