From 860e85a4cb4aeaca362502174341ef688ccd18dd Mon Sep 17 00:00:00 2001 From: Alex Axthelm Date: Thu, 26 Sep 2024 15:29:33 +0200 Subject: [PATCH] PUt all RE studff in one block --- R/create_interactive_report.R | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/R/create_interactive_report.R b/R/create_interactive_report.R index 4c46668..be3a17f 100644 --- a/R/create_interactive_report.R +++ b/R/create_interactive_report.R @@ -105,14 +105,6 @@ create_interactive_report <- file.copy(inst_path("webfonts"), to = output_dir, overwrite = TRUE, recursive = TRUE) file.copy(inst_path("font"), to = output_dir, overwrite = TRUE, recursive = TRUE) - if (length(list.files(real_estate_dir)) > 0) { - fs::dir_copy( - fs::path(real_estate_dir, "pdf"), - fs::path(output_dir, "real_estate"), - overwrite = TRUE - ) - } - survey_dir <- fs::path(survey_dir, toupper(language_select)) if (dir.exists(survey_dir)) { dir.create(fs::path(output_dir, "survey"), showWarnings = FALSE) @@ -120,13 +112,6 @@ create_interactive_report <- file.copy(survey_files, to = fs::path(output_dir, "survey"), overwrite = TRUE, recursive = TRUE) } - # real estate path --------------------------------------------------------- - - real_estate_file <- fs::path(output_dir, "real_estate") |> - fs::dir_info() |> - dplyr::filter(grepl("es_.*_de", path)) |> - dplyr::pull(path) - # translations ------------------------------------------------------------- dictionary <- choose_dictionary_language( @@ -475,6 +460,15 @@ create_interactive_report <- # confirm with Wim as to whether the dir won't exist if there are no results to print if (length(list.files(real_estate_dir)) > 0) { real_estate_flag <- TRUE + fs::dir_copy( + fs::path(real_estate_dir, "pdf"), + fs::path(output_dir, "real_estate"), + overwrite = TRUE + ) + real_estate_file <- fs::path(output_dir, "real_estate") |> + fs::dir_info() |> + dplyr::filter(grepl("es_.*_de", path)) |> + dplyr::pull(path) }