diff --git a/Master RMarkdown Document & Render Code/Locality Profiles Render Code.R b/Master RMarkdown Document & Render Code/Locality Profiles Render Code.R index ca46529..e421528 100755 --- a/Master RMarkdown Document & Render Code/Locality Profiles Render Code.R +++ b/Master RMarkdown Document & Render Code/Locality Profiles Render Code.R @@ -44,31 +44,33 @@ locality_list <- lookup %>% # 1. HSCP Services Map -map <- glue::glue(lp_path,"Master RMarkdown Document & Render Code/Output/maps","/",HSCP,".png") +map <- paste0(lp_path, "Master RMarkdown Document & Render Code/Output/maps/", HSCP, ".png") + +stopifnot(file.exists(map)) # Error if the file path doesn't exist. # 2. Loop through each locality to create the main body of the profiles and the summary table for (LOCALITY in locality_list) { ## 2a) Source in all the scripts for a given LOCALITY - + # demographics source("Demographics/1. Demographics - Population.R") source("./Demographics/2. Demographics - SIMD.R") - + # housing source("./Households/Households Code.R") - + # services source("./Services/2. Services data manipulation & table.R") - + # general health source("./General Health/3. General Health Outputs.R") - + # lifestyle & risk factors source("./Lifestyle & Risk Factors/2. Lifestyle & Risk Factors Outputs.R") - + # unscheduled care source("./Unscheduled Care/2. Unscheduled Care outputs.R") - + # appendices source("./Master RMarkdown Document & Render Code/Tables for Appendix.R") @@ -76,9 +78,9 @@ for (LOCALITY in locality_list) { detach(package:tidylog, unload = TRUE) ## 2b) Create the main body of the profiles - + rmarkdown::render("./Master RMarkdown Document & Render Code/Locality_Profiles_Master_Markdown.Rmd", - output_file = paste0(LOCALITY, " - Locality Profile.docx"), + output_file = paste0(LOCALITY, " - Locality Profile.docx"), output_dir = paste0(lp_path, "Master RMarkdown Document & Render Code/Output/") ) diff --git a/Master RMarkdown Document & Render Code/Locality_Profiles_Master_Markdown.Rmd b/Master RMarkdown Document & Render Code/Locality_Profiles_Master_Markdown.Rmd index 4717ad7..47238e9 100755 --- a/Master RMarkdown Document & Render Code/Locality_Profiles_Master_Markdown.Rmd +++ b/Master RMarkdown Document & Render Code/Locality_Profiles_Master_Markdown.Rmd @@ -26,21 +26,21 @@ y <- 1 # tables # # demographics # source("Demographics/Scripts/1. Demographics - Population.R") # source("Demographics/Scripts/2. Demographics - SIMD.R") -# +# # # housing # source("Households/Scripts/Households Code.R") -# +# # # services # source("Services/Scripts/2. Services data manipulation & table.R") # # services map (uncomment this when testing out individual localities) # # source("Services/Scripts/3. Service HSCP map.R") -# +# # # general health # source("General Health/Scripts/3. General Health Outputs.R") -# +# # # lifestyle & risk factors # source("Lifestyle & Risk Factors/Scripts/2. Lifestyle & Risk Factors Outputs.R") -# +# # # unscheduled care # source("Unscheduled Care/Scripts/2. Unscheduled Care outputs.R") # @@ -203,8 +203,7 @@ x <- x + 1 \newline ```{r echo = FALSE} -#knitr::include_graphics(map) -htmltools::img(map) +knitr::include_graphics(map, rel_path = FALSE) x <- x + 1 ```