formatDate {EHRtemporalVariability} | R Documentation |
Function to transform dates into "Date" R format
Description
Given a data.frame
object with a column of dates in 'character' format,
it generates a new data.frame
object with the dates transformed into
"Date" R format.
Usage
formatDate(input, dateColumn, dateFormat = "%y/%m/%d", verbose = FALSE)
Arguments
input |
A |
dateColumn |
The name of the column containing the date. |
dateFormat |
By default |
verbose |
By default |
Value
An object of class data.frame
with the date column transform into 'Date' R class.
Examples
dataset <- read.csv2(system.file("extdata",
"nhdsSubset.csv",
package="EHRtemporalVariability"),
sep = ",",
header = TRUE,
na.strings = "",
colClasses = c( "character", "numeric", "factor",
"numeric" , rep( "factor", 22 ) ) )
datasetFormatted <- formatDate(
input = dataset,
dateColumn = "date",
dateFormat = "%y/%m",
)
[Package EHRtemporalVariability version 1.2.1 Index]