Description Usage Arguments Details Author(s) See Also
View source: R/convert_datatable_StringDate.R
Converts a data.table's columns from strings to to IDates. This conversion is done BY REFERENCE meaning that the original data.table is modified.
1 2 3 4 5 6 7 | convert_datatable_StringDate(
dat,
cols,
fmt = NULL,
tz = "GMT",
newclass = c("POSIXct", "IDate", "ITime")[2]
)
|
dat |
A data.table |
cols |
An OPTIONAL subset of columns to search (see details) |
fmt |
Format for conversion, default assumes "YYYY-MM-DD HH:MM:SS" aka "%Y-%m-%d %H:%M:%S" |
tz |
Timezone to convert to (only used for POSIX). Default is "GMT" |
The data.table is returned invisibly if needed.
Only POSIXct is used.
The cols can be specified as a character vector of column names. The entire data.table is returned, but only the columns in "cols" are searched. A warning is produced if no columns are character.
Gene Leynes
data.table
as.IDate
set
strptime
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.