Skip to content

Commit

Permalink
Merge pull request #27 from jzwart/code_release_v1
Browse files Browse the repository at this point in the history
Adding in changes prior to submission
  • Loading branch information
jzwart authored Nov 29, 2022
2 parents 0a3f15c + c55aa8d commit 19d1d12
Show file tree
Hide file tree
Showing 48 changed files with 3,317 additions and 344 deletions.
2 changes: 1 addition & 1 deletion 0_process/src/process_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ collate_inlake_nutrient_timeseries <- function(
){

in_lake_nutrients = read_csv(inlake_nutrient_file)

browser()
# Lilli doesn't have DOC data; Mendota and Trout have multiple depths => using surface for their nutrients (0 meters)
in_lake_nutrients = in_lake_nutrients %>%
dplyr::filter(depth_m %in% c(0,NA)) %>%
Expand Down
97 changes: 89 additions & 8 deletions 1_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,74 @@ source('1_plot/src/plotting_functions.R', encoding = 'UTF-8')

p1_targets <- list(

tar_target(
p1_lake_label,
{
metab_data = filter_metab_timeseries(metab_data = p0_metab_timeseries_data,
season_data = p0_season_cutoff_data,
config = p0_config)
#ordering by mean GPP
lakes_sorted <- mutate(metab_data, lake = as.character(lake)) %>%
group_by(lake) %>%
summarise(mean_gpp = mean(mean_gpp), .groups = "drop") %>%
arrange(mean_gpp) %>%
mutate(label_id = n():1)

return(lakes_sorted)
}
),

# metabolism time series plot
tar_target(
p1_metab_timeseries_plot_png,
plot_metab_timeseries(
metab_data = p0_metab_timeseries_data,
season_data = p0_season_cutoff_data,
config = p0_config,
out_file = '1_plot/out/metab_timeseries_plot.png'
out_file = "1_plot/out/fig_6_metab_timeseries_plot.png"
),
format = 'file'
format = "file"
),

tar_target(
p1_doc_timeseries_plot_png,
plot_doc_timeseries(
load_data = p0_load_timeseries_data,
inlake_data = p0_inlake_nutrient_timeseries_data,
config = p0_config,
out_file = "1_plot/out/fig_S3_doc_timeseries_plot.png"
),
format = "file"
),

tar_target(
p1_tp_timeseries_plot_png,
plot_tp_timeseries(
load_data = p0_load_timeseries_data,
inlake_data = p0_inlake_nutrient_timeseries_data,
config = p0_config,
out_file = "1_plot/out/fig_S1_tp_timeseries_plot.png"
),
format = "file"
),

tar_target(
p1_tn_timeseries_plot_png,
plot_tn_timeseries(
load_data = p0_load_timeseries_data,
inlake_data = p0_inlake_nutrient_timeseries_data,
config = p0_config,
out_file = "1_plot/out/fig_S2_tn_timeseries_plot.png"
),
format = "file"
),
tar_target(
p1_stoich_load_timeseries_png,
plot_stoich_timeseries(
load_data = p0_load_timeseries_data,
inlake_data = p0_inlake_nutrient_timeseries_data,
config = p0_config,
out_file = '1_plot/out/stoich_timeseries_plot.png'
out_file = '1_plot/out/fig_4_stoich_timeseries_plot.png'
),
format = 'file'
),
Expand All @@ -35,7 +84,8 @@ p1_targets <- list(
load_data = p0_load_timeseries_data,
inlake_data = p0_inlake_nutrient_timeseries_data,
config = p0_config,
out_file = '1_plot/out/stream_lake_nutrient_1_1.png'
label_id = p1_lake_label,
out_file = '1_plot/out/fig_2_stream_lake_nutrient_1_1.png'
),
format = 'file'
),
Expand All @@ -46,7 +96,8 @@ p1_targets <- list(
load_data = p0_load_timeseries_data,
inlake_data = p0_inlake_nutrient_timeseries_data,
config = p0_config,
out_file = '1_plot/out/stream_lake_stoich_scatter.png'
label_id = p1_lake_label,
out_file = '1_plot/out/fig_3_stream_lake_stoich_scatter.png'
),
format = 'file'
),
Expand All @@ -57,23 +108,26 @@ p1_targets <- list(
load_data = p0_load_timeseries_data,
inlake_data = p0_inlake_nutrient_timeseries_data,
config = p0_config,
out_file = '1_plot/out/plot_stoich_stream_vs_lake.png'
label_id = p1_lake_label,
out_file = '1_plot/out/fig_5_plot_stoich_stream_vs_lake.png'
)
),

tar_target(
p1_plot_obs_pred_metab_inlake_png,
plot_obs_pred_metab_inlake(
annual_data = p2_annual_data,
out_file = '1_plot/out/plot_obs_pred_metab_inlake.png'
label_id = p1_lake_label,
out_file = '1_plot/out/fig_S4_plot_obs_pred_metab_inlake.png'
)
),

tar_target(
p1_plot_obs_pred_metab_load_png,
plot_obs_pred_metab_load(
annual_data = p2_annual_data,
out_file = '1_plot/out/plot_obs_pred_metab_load.png'
label_id = p1_lake_label,
out_file = '1_plot/out/fig_S5_plot_obs_pred_metab_load.png'
)
),

Expand All @@ -99,6 +153,33 @@ p1_targets <- list(
annual_data = p2_annual_data,
out_file = '1_plot/out/plot_obs_resid_metab_load.png'
)
),

tar_target(
p1_plot_inlake_models_png,
plot_models_inlake(
annual_data = p2_annual_data,
label_id = p1_lake_label,
out_file = '1_plot/out/fig_7_inlake_models.png'
)
),

tar_target(
p1_plot_load_models_png,
plot_models_load(
annual_data = p2_annual_data,
label_id = p1_lake_label,
out_file = '1_plot/out/fig_8_load_models.png'
)
),

tar_target(
p1_plot_doc_gpp_png,
plot_doc_gpp(
annual_data = p2_annual_data,
label_id = p1_lake_label,
out_file = '1_plot/out/fig_S6_doc_gpp.png'
)
)
)

Binary file added 1_plot/out/fig_2_stream_lake_nutrient_1_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_3_stream_lake_stoich_scatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_4_stoich_timeseries_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_5_plot_stoich_stream_vs_lake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_6_metab_timeseries_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_7_inlake_models.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_8_load_models.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_S1_tp_timeseries_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_S2_tn_timeseries_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_S3_doc_timeseries_plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_S4_plot_obs_pred_metab_inlake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_S5_plot_obs_pred_metab_load.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1_plot/out/fig_S6_doc_gpp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed 1_plot/out/metab_timeseries_plot.png
Binary file not shown.
Binary file removed 1_plot/out/plot_gpp_r.png
Binary file not shown.
Binary file removed 1_plot/out/plot_obs_pred_metab_inlake.png
Binary file not shown.
Binary file removed 1_plot/out/plot_obs_pred_metab_load.png
Binary file not shown.
Binary file removed 1_plot/out/plot_obs_resid_metab_inlake.png
Binary file not shown.
Binary file removed 1_plot/out/plot_obs_resid_metab_load.png
Binary file not shown.
Binary file removed 1_plot/out/plot_stoich_stream_vs_lake.png
Binary file not shown.
Binary file removed 1_plot/out/stoich_timeseries_plot.png
Binary file not shown.
Binary file removed 1_plot/out/stream_lake_nutrient_1_1.png
Binary file not shown.
Binary file removed 1_plot/out/stream_lake_stoich_scatter.png
Binary file not shown.
Loading

0 comments on commit 19d1d12

Please sign in to comment.