I attempted to render a revealjs
presentation using parameterized reporting. Even though I specified revealjs as the format in the YAML header and set the output_format
to “revealjs” in the quarto_render
function, I still ended up with a standard HTML file without revealjs functionality.
When I render the revealjs.qmd
file (Individual_Report.qmd
) directly, it works fine. The issue only occurs when I use the parameterized reporting R script.
Here is the YAML header:
---
title: "ABC"
format
revealjs:
theme: default
embed-resources: true
params:
token: null
---
Here is the R script
library(quarto)
library(tidyverse)
library(haven)
library(here)
setwd("S:/Projects/Benchmarking/Individual Reports Output")
data <- read_dta('S:/Projects/Benchmarking/Data/data_respondents_benchmarking.dta')
data <- data %>%
mutate(across(c(function_group, function_subgroup, token), as_factor)) %>%
mutate(across(-c(function_group, function_subgroup, token), as.numeric))
set.seed(123)
subset_data <- data %>%
slice_sample(n = 2)
tokens <-
subset_data |>
distinct(token) |>
pull(token) |>
as.character()
reports <-
tibble(
output_file = file.path(str_glue("{tokens}.html")),
execute_params = map(tokens, ~list(token = .))
)
pwalk(reports,
quarto_render,
input = here::here("S:/Projects/Benchmarking/Individual_Report.qmd"),
output_format = "revealjs",
.progress = TRUE
)
Does anyone see what the issue could be?
2
Thank you for the answer. The error was because the output files were being saved to setwd("S:/Projects/Benchmarking/Individual Reports Output")
while the Individual_Report.qmd"
was stored in "S:/Projects/Benchmarking"
.
Due to this all the plugins stored in Individual_Report_files/libs
were not being accessed.
Changing the working directory to setwd("S:/Projects/Benchmarking")
solved the issue!
1