I was adding a test that has a step to make a table and figure. I want to place these in a folder rather than the wd since I will be placing the report in that folder as well. The figure has no issue producing the rda and figures folder inside of this, but for some reason the table is struggling.
It produces this error:
Error in if (file.exists(fs::path(figures_tables_dir, rda_loc, output_file_name))) { : the condition has length > 1
with this code:
dir.create("species_year1")
year1_dir <- fs::path(getwd(), "species_year1")
# make example table and figure
withr::with_dir(
year1_dir, {
stockplotr::plot_spawning_biomass(
stockplotr::example_data,
make_rda = TRUE,
# figures_dir = x,
interactive = FALSE
)
stockplotr::table_index(
stockplotr::example_data,
make_rda = TRUE,
# tables_dir = x,
interactive = FALSE
)
}
)
I have also tried this:
dir.create("species_year1")
year1_dir <- fs::path(getwd(), "species_year1")
# make example table and figure
withr::with_dir(
year1_dir, {
stockplotr::table_index(
stockplotr::example_data,
make_rda = TRUE,
# tables_dir = x,
interactive = FALSE
)
}
)
I was adding a test that has a step to make a table and figure. I want to place these in a folder rather than the wd since I will be placing the report in that folder as well. The figure has no issue producing the rda and figures folder inside of this, but for some reason the table is struggling.
It produces this error:
Error in if (file.exists(fs::path(figures_tables_dir, rda_loc, output_file_name))) { : the condition has length > 1with this code:
I have also tried this: