I have a dataset in R with 3 columns of numbers that I need to convert to a vector of dates -
I have a dataset in R with 3 columns of numbers that I need to convert to a vector of dates -
in data.frame 3 variables month, dayofthemonth ,dayoftheweek, info in same year. need convert these columns vector plotting using ggplot2
variable info:
date_cols = data.frame(month=1:12, dayofthemonth=1:31, dayoftheweek=1:7)
#(monday=1)
in case need month , day of month,
dd<-data.frame(month=rep(1:3, each=5), dayofthemonth=rep(seq(1,length.out=5, by=5), 3))
i can covert info dates
as.date(sprintf("%04d-%02d-%02d", 2014, dd$month, dd$dayofthemonth))
all convert canonical date-time format , add together in year, utilize as.date
transformation.
r date ggplot2
Comments
Post a Comment