Try:
df$date <- as.Date(with(df, paste(year, mon, day,sep="-")), "%Y-%m-%d")
df$date
#[1] "1947-01-01" "1947-04-01" "1947-07-01" "1947-10-01" "1948-01-01"
#[6] "1948-04-01"
More Related Contents:
- How to sort a character vector where elements contain letters and numbers in R?
- Filter rows which contain a certain string
- Apply function conditionally
- Gantt charts with R
- Create integer sequences defined by ‘from’ and ‘to’ vectors
- Is set.seed consistent over different versions of R (and Ubuntu)?
- duplicates in multiple columns
- Select values from different columns based on a variable containing column names [duplicate]
- Filling area under curve based on value
- R self reference
- R keep rows with at least one column greater than value
- Command Lines error in Rstudio console
- Get all Parameters as List
- Creating regular 15-minute time-series from irregular time-series
- Efficiently computing a linear combination of data.table columns
- Rounding numbers in R to specified number of digits
- Unlist a data frame by rows, not columns
- How to add table of contents in Rmarkdown?
- How do you delete a column by name in data.table?
- Applying a function to two lists?
- Merging two sets of data by data.table roll=’nearest’ function
- Drawing a barchart to compare two sets of data using ggplot2 package?
- Plotting multiple graphs in R [closed]
- Applying a function to each row of a data.table
- R: Calculate cosine distance from a term-document matrix with tm and proxy
- Programming-safe version of subset – to evaluate its condition while called from another function
- ggplot2 – using two different color scales for overlayed plots
- Extract digit from numeric in r
- What does the period mean when used with ~ (in a formula)?
- heatmap-like plot, but for categorical variables