Code
<- knitr::opts_chunk$get("rmarkdown.pandoc.to") out_type
We read all tabular data from the previous section.
We export the standardised data to an excel file called harmonised_Cohort_B.xlsx
# Create a new workbook
my_workbook <- openxlsx::createWorkbook()
sheet_name = c("demographics")
output_data = list(demo_behave_data) |>
purrr::map(
.f = harmonisation::add_cohort_name,
cohort_name = params$cohort_name,
cohort_name_column = "cohort_name"
)
purrr::walk2(
.x = sheet_name,
.y = output_data,
.f = harmonisation::write_to_sheet,
workbook = my_workbook
)
# Save workbook
openxlsx::saveWorkbook(
wb = my_workbook,
file = here::here(params$analysis_folder,
params$output_folder,
params$cleaned_folder,
params$output_excel_file),
overwrite = TRUE
)