I'd like to set date in YAML in R Markdown settings using following function:
paste(month(previous_month(part="start"),label=TRUE,locale=Sys.setlocale("LC_TIME", "English"),abbr=FALSE), year(previous_month(part="start")), sep=" ")
but this code contains functions from 2 packages: timeperiodsR and lubridate, so it's necessary to prior use library(timeperiodsR) and library(lubridate).
How should code after date: look like, because the following is not working?
title: " "
date: '`r library(timeperiodsR) library(lubridate) paste(month(previous_month(part="start"),label=TRUE,locale=Sys.setlocale("LC_TIME", "English"),abbr=FALSE), year(previous_month(part="start")), sep=" ")`'
output:
html_document:
toc: true
toc_depth: 2
toc_float:
collapsed: false
smooth_scroll: false
fig_align: 'center'
