convert_datatable_StringDate: Find and convert data.table columns from Strings to IDate

Description Usage Arguments Details Author(s) See Also

View source: R/convert_datatable_StringDate.R

Description

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.

Usage

1
2
3
4
5
6
7
convert_datatable_StringDate(
  dat,
  cols,
  fmt = NULL,
  tz = "GMT",
  newclass = c("POSIXct", "IDate", "ITime")[2]
)

Arguments

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"

Details

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.

Author(s)

Gene Leynes

See Also

data.table as.IDate set strptime


geneorama/geneorama documentation built on Oct. 17, 2020, 12:35 a.m.