Skip to content

Commit

Permalink
Correct names folders for graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
heleenderoo committed May 13, 2024
1 parent c7092db commit c7460b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions src/stock_calculations/functions/get_stocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,18 @@ get_stocks <- function(survey_form,

if (graph == TRUE) {

if (!dir.exists(paste0(dir, "splines_per_profile/"))) {
dir.create(paste0(dir, "splines_per_profile/"), recursive = TRUE)
for (survey_form_i in survey_forms) {

if (!dir.exists(paste0(dir, survey_form_i,
"_splines_per_profile/"))) {
dir.create(paste0(dir, survey_form_i,
"_splines_per_profile/"), recursive = TRUE)
}
}

if (!dir.exists(paste0(dir, "splines_per_plot/"))) {
dir.create(paste0(dir, "splines_per_plot/"), recursive = TRUE)
if (!dir.exists(paste0(dir, code_survey, "_splines_per_plot/"))) {
dir.create(paste0(dir, code_survey, "_splines_per_plot/"),
recursive = TRUE)
}
}

Expand Down Expand Up @@ -2422,7 +2428,7 @@ if (length(survey_forms) == 2) {


ggsave(filename = paste0(plot_id_i, ".png"),
path = paste0(dir, "splines_per_plot/"),
path = paste0(dir, code_survey, "_splines_per_plot/"),
plot = p,
dpi = 500,
height = height_i,
Expand Down
4 changes: 2 additions & 2 deletions src/stock_calculations/functions/soilspline.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ soilspline <- function(id,
as.character(format(as.Date(
get_date_local(path = "./data/raw_data/")),
format = "%Y%m%d")),
"_carbon_stocks/",
"splines_per_profile/")
"_carbon_stocks/", survey_form,
"_splines_per_profile/")

assertthat::assert_that(
dir.exists(path))
Expand Down

0 comments on commit c7460b2

Please sign in to comment.