Last updated: 2021-05-18

Checks: 7 0

Knit directory: BloomSail/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20191021) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 00a2574. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    data/
    Ignored:    output/Plots/Figures_publication/.tmp.drivedownload/

Untracked files:
    Untracked:  data_os-2020-120_submission.zip

Unstaged changes:
    Modified:   code/Workflowr_project_managment.R
    Modified:   output/Plots/Figures_publication/Appendix/Fig_A1.pdf
    Modified:   output/Plots/Figures_publication/Appendix/Fig_A2.pdf
    Modified:   output/Plots/Figures_publication/Appendix/Fig_B1.pdf
    Modified:   output/Plots/Figures_publication/Appendix/Fig_B2.pdf
    Modified:   output/Plots/Figures_publication/Appendix/Fig_B2.png
    Modified:   output/Plots/Figures_publication/Appendix/Fig_C1.pdf
    Modified:   output/Plots/Figures_publication/Appendix/Fig_C2.pdf
    Modified:   output/Plots/Figures_publication/Appendix/Fig_C3.pdf
    Modified:   output/Plots/Figures_publication/Appendix/Fig_C4.pdf
    Modified:   output/Plots/Figures_publication/Article/Fig_1.pdf
    Modified:   output/Plots/Figures_publication/Article/Fig_2.pdf
    Modified:   output/Plots/Figures_publication/Article/Fig_3.pdf
    Modified:   output/Plots/Figures_publication/Article/Fig_4.pdf
    Modified:   output/Plots/Figures_publication/Article/Fig_5.pdf
    Modified:   output/Plots/Figures_publication/Article/Fig_6.pdf
    Modified:   output/Plots/NCP_best_guess/tm_profiles_ID_pCO2_tem_sal_CT.pdf
    Modified:   output/Plots/NCP_best_guess/tm_profiles_pCO2_tem_sal_CT.pdf
    Modified:   output/Plots/response_time/all_plots.pdf
    Modified:   output/Plots/response_time/profiles_pCO2.pdf
    Modified:   output/Plots/response_time/profiles_pCO2_delta_grid.pdf
    Modified:   output/Plots/response_time/profiles_pCO2_delta_rel_grid.pdf
    Modified:   output/Plots/response_time/profiles_pCO2_grid.pdf
    Modified:   output/Plots/response_time/tau_determination_pCO2_corr_flushperiods_nls.pdf
    Modified:   output/Plots/response_time/time_series_depth_pCO2_corr_by_profile.pdf

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/Phytoplankton.Rmd) and HTML (docs/Phytoplankton.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
html 00a2574 jens-daniel-mueller 2021-05-10 Build site.
html ac739b8 jens-daniel-mueller 2021-05-10 Build site.
Rmd bc5c2d0 jens-daniel-mueller 2021-05-10 removed grid lines
html 61e452c jens-daniel-mueller 2021-04-16 Build site.
html 5f4fb9a jens-daniel-mueller 2021-02-20 Build site.
html 516b294 jens-daniel-mueller 2021-02-18 Build site.
html 8225403 jens-daniel-mueller 2021-02-18 Build site.
Rmd a29eb83 jens-daniel-mueller 2021-02-18 cleaning
html 70a8950 jens-daniel-mueller 2021-02-11 Build site.
html 8051798 jens-daniel-mueller 2021-02-10 Build site.
html afbabd0 jens-daniel-mueller 2021-01-29 Build site.
Rmd 8410144 jens-daniel-mueller 2021-01-29 resized appendix figures
html 6adb9ab jens-daniel-mueller 2021-01-29 Build site.
Rmd 54ec4b0 jens-daniel-mueller 2021-01-29 renamed appendix figures
html c5fc34c jens-daniel-mueller 2021-01-22 Build site.
Rmd f656a73 jens-daniel-mueller 2021-01-22 all figs revised
html 4277235 jens-daniel-mueller 2021-01-05 Build site.
Rmd 58c1637 jens-daniel-mueller 2021-01-05 new Fig_AX names, A5 added
html 9102406 jens-daniel-mueller 2020-11-06 Build site.
Rmd bf70fd5 jens-daniel-mueller 2020-11-06 removed sec axis with moles-C unit
html 7e29c30 jens-daniel-mueller 2020-11-02 Build site.
Rmd 7e5a700 jens-daniel-mueller 2020-11-02 renamed and revised figures for publication
html e9306ef jens-daniel-mueller 2020-10-26 Build site.
Rmd 1b371ec jens-daniel-mueller 2020-10-26 included total biomass
html 9a3f42a jens-daniel-mueller 2020-10-24 Build site.
Rmd 766a349 jens-daniel-mueller 2020-10-24 biomass unit conversion
html b289357 jens-daniel-mueller 2020-10-24 Build site.
Rmd 576f7f9 jens-daniel-mueller 2020-10-24 unit conversion biomass
html dd00fd3 jens-daniel-mueller 2020-10-24 Build site.
Rmd 58406a9 jens-daniel-mueller 2020-10-24 unit conversion biomass
html c9a2935 jens-daniel-mueller 2020-10-24 Build site.
Rmd 5fd3472 jens-daniel-mueller 2020-10-24 unit conversion biomass
html 05248bf jens-daniel-mueller 2020-10-20 Build site.
html 1c4fe8e jens-daniel-mueller 2020-10-20 table with time series in depth intervals added
html 6896725 jens-daniel-mueller 2020-10-01 Build site.
html 9f66019 jens-daniel-mueller 2020-10-01 Build site.
html 27c5431 jens-daniel-mueller 2020-09-29 Build site.
Rmd 2e0f902 jens-daniel-mueller 2020-09-29 all parameters separate, rebuild
html 1d01685 jens-daniel-mueller 2020-09-28 Build site.
html 1278900 jens-daniel-mueller 2020-09-25 Build site.
html 904f0f7 jens-daniel-mueller 2020-09-23 Build site.
html c919fb7 jens-daniel-mueller 2020-06-29 Build site.
Rmd 1461cb6 jens-daniel-mueller 2020-06-29 Fig update for talk
html 603af23 jens-daniel-mueller 2020-05-25 Build site.
html 3414c23 jens-daniel-mueller 2020-05-25 Build site.
html 9ccd9a3 jens-daniel-mueller 2020-05-25 Build site.
Rmd 9bedac5 jens-daniel-mueller 2020-05-25 revised pp time series plot
html ae61e7e jens-daniel-mueller 2020-05-25 Build site.
Rmd 3080fb3 jens-daniel-mueller 2020-05-25 Added Phytoplanktion read-in and new Rmd

library(tidyverse)

1 Scope of this script

  • Read and plot phytoplankton data

2 Phytoplankton cell counts

2.1 Data preparation

# read file
tp <- read_csv(
  here::here("data/intermediate/_summarized_data_files",
             "tp.csv"),
  col_types = cols(ID = col_character())
)

# read cruise dates
cruise_dates <-
  read_csv(
    here::here(
      "data/intermediate/_summarized_data_files",
      "cruise_date.csv"
    ),
    col_types = cols(ID = col_character())
  )

# filter relevant data
tp <- tp %>%
  filter(
    station %in% parameters$stations_in_phytoplankton,
    class == parameters$class_in_phytoplankton,
    Species != "Nodulariadead"
  ) %>%
  mutate(ID = if_else(ID == "180722", "180723", ID))

# calculate mean total phytoplankton biomass in different water depth intervals
tp <- tp %>%
  mutate(dep_grid = cut(
    dep,
    breaks = c(-1, parameters$surface_dep, parameters$max_dep),
    labels = c("0-6", "6-25")
  )) %>%
  drop_na()

# calculate mean biomass in depth interval
tp_ID_grid <- tp %>%
  group_by(ID, dep_grid, Species) %>%
  summarise(value = mean(value, na.rm = TRUE)) %>%
  ungroup()

# join with cruise dates
tp_ID_grid <- full_join(cruise_dates, tp_ID_grid)

2.2 Time series plot

tp_ID_grid %>%
  filter(Species != "total") %>%
  ggplot(aes(date_time_ID, value, col = dep_grid)) +
  geom_point() +
  geom_line() +
  facet_grid(Species~.) +
  scale_color_brewer(palette = "Set1", name = "Depth (m)") +
  scale_x_datetime(breaks = "week", date_labels = "%d %b") +
  labs(y = expression(Biomass ~ (mg~m^-3))) +
  theme(axis.title.x = element_blank(),
        panel.grid.minor = element_blank())

ggsave(
  here::here(
    "output/Plots/Figures_publication/appendix",
    "Fig_B2.pdf"
  ),
  width = 140,
  height = 90,
  dpi = 300,
  units = "mm"
)

ggsave(
  here::here(
    "output/Plots/Figures_publication/appendix",
    "Fig_B2.png"
  ),
  width = 140,
  height = 90,
  dpi = 300,
  units = "mm"
)

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_Germany.1252  LC_CTYPE=English_Germany.1252   
[3] LC_MONETARY=English_Germany.1252 LC_NUMERIC=C                    
[5] LC_TIME=English_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] forcats_0.5.0   stringr_1.4.0   dplyr_1.0.2     purrr_0.3.4    
 [5] readr_1.4.0     tidyr_1.1.2     tibble_3.0.4    ggplot2_3.3.3  
 [9] tidyverse_1.3.0 workflowr_1.6.2

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.0   xfun_0.19          haven_2.3.1        colorspace_2.0-0  
 [5] vctrs_0.3.6        generics_0.1.0     htmltools_0.5.0    yaml_2.2.1        
 [9] rlang_0.4.10       later_1.1.0.1      pillar_1.4.7       withr_2.3.0       
[13] glue_1.4.2         DBI_1.1.0          RColorBrewer_1.1-2 dbplyr_2.0.0      
[17] modelr_0.1.8       readxl_1.3.1       lifecycle_0.2.0    munsell_0.5.0     
[21] gtable_0.3.0       cellranger_1.1.0   rvest_0.3.6        evaluate_0.14     
[25] labeling_0.4.2     knitr_1.30         ps_1.5.0           httpuv_1.5.4      
[29] fansi_0.4.1        broom_0.7.5        Rcpp_1.0.5         promises_1.1.1    
[33] backports_1.2.1    scales_1.1.1       jsonlite_1.7.2     farver_2.0.3      
[37] fs_1.5.0           hms_0.5.3          digest_0.6.27      stringi_1.5.3     
[41] rprojroot_2.0.2    grid_4.0.3         here_1.0.1         cli_2.2.0         
[45] tools_4.0.3        magrittr_2.0.1     crayon_1.3.4       whisker_0.4       
[49] pkgconfig_2.0.3    ellipsis_0.3.1     xml2_1.3.2         reprex_0.3.0      
[53] lubridate_1.7.9.2  assertthat_0.2.1   rmarkdown_2.6      httr_1.4.2        
[57] rstudioapi_0.13    R6_2.5.0           git2r_0.27.1       compiler_4.0.3