Description Usage Arguments Value Examples
View source: R/variable_operations.R
Calculate age variable in years from an existing calendar year variable in dataset by subtracting year variable from System Date
1 |
data |
name of dataset |
variable |
variable name whose age is to be calculated |
a dataframe with age as a vector
1 2 3 4 5 | csv = system.file("extdata", 'agedata.csv', package = "nacleanR")
agedata <- read_data(csv)
agedata$ageTodaySinceBuilt <- age_cal(agedata,"YearBuilt")
agedata$ageTodaySinceRenovated <- age_cal(agedata, "YearRenovated")
head(agedata)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.