View source: R/btools_utilities.r
safe.ifelse | R Documentation |
ifelse that can be used safely with dates
safe.ifelse(cond, yes, no)
cond |
Logical expression. |
yes |
Resulting value if cond is TRUE. |
no |
Resulting value if cond is FALSE. |
# snippet: mutate(date=safe.ifelse(freq=='A', as.Date(paste0(olddate, '-01-01')), date))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.