colToDate: Convert a Character Time Column into a Date and Strip Out...

Description Usage Arguments Examples

View source: R/colToDate.R

Description

This function converts a character column in a data frame to time and then strips out day and hour of the time as new columns. The output is a new data frame with one modified column (character converted to date) and two new columns (day of week and hour of day).

Usage

1
colToDate(dat, dateColName, dateFormat)

Arguments

dat

This is the data source to be converted

dateColName

This is the name of the date column to be converted

dateFormat

This is the format of the date column

Examples

1
2
testDat <- data.frame(stringsAsFactors = FALSE, time = c("2016-10-31","2016-12-25","2016-07-04"),event = c("Halloween","Christmas","US Independence Day"))
testDat <- colToDate(testDat,"time","%Y-%m-%d")

jsdeherrera/shinyBoots documentation built on May 20, 2019, 2:08 a.m.