# Resolving macro variable in single character
year <- 2026
text <- macro("The current year is &year")
# You can also combine multiple macro variables
some_variable <- "current"
current2026 <- "The current year is"
text_combi <- macro("&&some_variable&year &year")
# Resolving macro variable in character vector
char_vector <- c("The current year is &year",
"The &some_variable year is &year",
"&&some_variable&year &year")
text_vector <- apply_macro(char_vector)
Run the code above in your browser using DataLab