Last updated: 2020-07-08

Checks: 7 0

Knit directory: Cant_eMLR/

This reproducible R Markdown analysis was created with workflowr (version 1.6.1). 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(20200707) 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 5de66c3. 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:    .Rproj.user/
    Ignored:    data/_summarized_data_files/

Untracked files:
    Untracked:  code/Workflowr_project_managment.R

Unstaged changes:
    Modified:   .gitignore
    Deleted:    analysis/about.Rmd
    Deleted:    analysis/read_data.Rmd

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/data_base.Rmd) and HTML (docs/data_base.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
Rmd 5de66c3 jens-daniel-mueller 2020-07-08 correct label GLODAPv2_2020
html 81670f8 jens-daniel-mueller 2020-07-08 Build site.
Rmd 36cbea0 jens-daniel-mueller 2020-07-08 read GLODAPv2_2020

library(tidyverse)
library(lubridate)

1 Reading original data

The file GLODAPv2.2020_Merged_Master_File.csv from glodap.info was used.

Only rows which have at least one talk or tco2 observation were subsetted.

GLODAP <- read_csv(here::here("data", "GLODAPv2.2020_Merged_Master_File.csv"),
                   na = "-9999",
                   col_types = cols(.default = col_double()))

# relevant columns
GLODAP <- GLODAP %>% 
  select(cruise:phtsqc)

# select columns with at least one talk or tco2 observation
GLODAP <- GLODAP %>% 
  filter(!is.na(talk) | !is.na(tco2))

# date and decade column
GLODAP <- GLODAP %>% 
  mutate(date = ymd(paste(year, month, day)),
         decade = as.factor(floor(year / 10) * 10))

GLODAP  %>%  write_csv(here::here("data/_summarized_data_files", "GLODAPv2.2020_Merged_Master_File_JM.csv"))

2 Overview GLODAPv2-2019

Saptio-temporal distribution of talk and tco2 data.

GLODAP <- read_csv(here::here("data/_summarized_data_files",
                              "GLODAPv2.2020_Merged_Master_File_JM.csv"),
                   guess_max = 1e5)

GLODAP <- GLODAP %>% 
  mutate(decade = as.factor(decade))

2.1 Histograms

GLODAP %>% 
  filter(!is.na(tco2)) %>% 
  ggplot(aes(latitude, fill=decade))+
  geom_vline(xintercept = -30, col="red")+
  geom_histogram(binwidth = 10, col="black", boundary = 0)+
  coord_cartesian(expand = 0)+
  scale_x_continuous(breaks = seq(-85,90,10))+
  scale_fill_viridis_d()+
  labs(title = "tco2 observations")

GLODAP %>% 
  filter(!is.na(talk)) %>% 
  ggplot(aes(latitude, fill=decade))+
  geom_vline(xintercept = -30, col="red")+
  geom_histogram(binwidth = 10, col="black", boundary = 0)+
  coord_cartesian(expand = 0)+
  scale_x_continuous(breaks = seq(-85,90,10))+
  scale_fill_viridis_d()+
  labs(title = "talk observations")

GLODAP %>% 
  filter(!is.na(talk) & !is.na(tco2)) %>% 
  ggplot(aes(latitude, fill=decade))+
  geom_vline(xintercept = -30, col="red")+
  geom_histogram(binwidth = 10, col="black", boundary = 0)+
  coord_cartesian(expand = 0)+
  scale_x_continuous(breaks = seq(-85,90,10))+
  scale_fill_viridis_d()+
  labs(title = "Paired tco2 + talk observations")

2.2 World map

mapWorld <- borders("world", colour="gray60", fill="gray60")

GLODAP %>% 
  filter(depth < 10) %>% 
  ggplot(aes(longitude, latitude))+
  mapWorld+
  geom_point()+
  geom_hline(yintercept = c(-30, -65), col="red")+
  scale_x_continuous(breaks = seq(-180, 180, 30))+
  scale_y_continuous(breaks = seq(-90, 90, 30))+
  coord_quickmap(expand = FALSE)+
  labs(title = "Observations within 0-10m water depth")


sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 10 x64 (build 18363)

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] lubridate_1.7.4 forcats_0.5.0   stringr_1.4.0   dplyr_0.8.5    
 [5] purrr_0.3.4     readr_1.3.1     tidyr_1.0.2     tibble_3.0.1   
 [9] ggplot2_3.3.0   tidyverse_1.3.0 workflowr_1.6.1

loaded via a namespace (and not attached):
 [1] jsonlite_1.6.1    rstudioapi_0.11   generics_0.0.2    magrittr_1.5     
 [5] farver_2.0.3      gtable_0.3.0      rmarkdown_2.1     vctrs_0.3.0      
 [9] fs_1.4.0          hms_0.5.3         xml2_1.3.0        pillar_1.4.4     
[13] htmltools_0.4.0   haven_2.2.0       later_1.0.0       broom_0.5.5      
[17] cellranger_1.1.0  lattice_0.20-41   tidyselect_1.1.0  knitr_1.28       
[21] git2r_0.26.1      whisker_0.4       lifecycle_0.2.0   pkgconfig_2.0.3  
[25] R6_2.4.1          digest_0.6.25     xfun_0.12         colorspace_1.4-1 
[29] rprojroot_1.3-2   stringi_1.4.6     yaml_2.2.1        evaluate_0.14    
[33] labeling_0.3      fansi_0.4.1       httr_1.4.1        compiler_3.6.3   
[37] here_0.1          cli_2.0.2         withr_2.1.2       backports_1.1.5  
[41] munsell_0.5.0     DBI_1.1.0         modelr_0.1.6      Rcpp_1.0.4.6     
[45] readxl_1.3.1      maps_3.3.0        dbplyr_1.4.2      ellipsis_0.3.1   
[49] assertthat_0.2.1  tools_3.6.3       reprex_0.3.0      httpuv_1.5.2     
[53] viridisLite_0.3.0 scales_1.1.0      crayon_1.3.4      glue_1.4.1       
[57] rlang_0.4.6       nlme_3.1-145      rvest_0.3.5       promises_1.1.0   
[61] grid_3.6.3