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 8de2366. 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 8de2366 jens-daniel-mueller 2020-07-08 Data cleaning, gridding, coverage plots
html 6f0ac0f jens-daniel-mueller 2020-07-08 Build site.
Rmd 9f12d15 jens-daniel-mueller 2020-07-08 Data cleaning, gridding, coverage plots
html 848d7c4 jens-daniel-mueller 2020-07-08 Build site.
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:talkqc)

# select rows with tco2, good flag
GLODAP_clean <- GLODAP %>% 
  filter(!is.na(tco2))

GLODAP_clean <- GLODAP_clean %>% 
  filter(tco2f == "2")

GLODAP_clean <- GLODAP_clean %>% 
  filter(tco2qc == "1")


# select rows with talk, good flag

GLODAP_clean <- GLODAP_clean %>% 
  filter(!is.na(talk))

GLODAP_clean <- GLODAP_clean %>% 
  filter(talkf == "2")

GLODAP_clean <- GLODAP_clean %>% 
  filter(talkqc == "1")


# select rows with talk, good flag

GLODAP_clean <- GLODAP_clean %>% 
  filter(!is.na(phosphate))

GLODAP_clean <- GLODAP_clean %>% 
  filter(phosphatef == "2")

GLODAP_clean <- GLODAP_clean %>% 
  filter(phosphateqc == "1")


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

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

2 Overview GLODAPv2-2020

Saptio-temporal distribution of paired talk, tco2, and phosphate data.

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

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

2.1 Gridding

GLODAP <- GLODAP %>% 
  mutate(lat_grid = cut(latitude, seq(-90, 90, 5), seq(-87.5, 87.5, 5)),
         lat_grid = as.numeric(as.character(lat_grid)),
         lon_grid = cut(longitude, seq(-180, 180, 5), seq(-177.5, 177.5, 5)),
         lon_grid = as.numeric(as.character(lon_grid)))

GLODAP_map_year <- GLODAP %>% 
  group_by(year, lat_grid, lon_grid) %>% 
  tally() %>% 
  ungroup()

GLODAP_map_decade <- GLODAP %>% 
  group_by(decade, lat_grid, lon_grid) %>% 
  tally() %>% 
  ungroup()

GLODAP_hovmoeller_year <- GLODAP %>% 
  group_by(year, lat_grid) %>% 
  tally() %>% 
  ungroup()

2.2 Histograms

GLODAP %>% 
  ggplot(aes(latitude, fill=decade))+
  geom_histogram(binwidth = 10, col="black", boundary = 0)+
  scale_x_continuous(breaks = seq(-85,90,10))+
  scale_fill_viridis_d()+
  coord_flip(expand = 0)+
  labs(title = "paired tco2 + talk + phosphate observations")

2.3 Hovmoeller (Lat-time)

GLODAP_hovmoeller_year %>% 
  ggplot(aes(year, lat_grid, fill=log10(n)))+
  geom_raster()+
  scale_fill_viridis_c(option = "magma")

2.4 Maps

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

GLODAP_map_decade %>%
  ggplot(aes(lon_grid, lat_grid, fill=log10(n)))+
  mapWorld+
  geom_raster()+
  scale_fill_viridis_c(option = "magma")+
  scale_x_continuous(breaks = seq(-180, 180, 30))+
  scale_y_continuous(breaks = seq(-90, 90, 30))+
  coord_quickmap(expand = FALSE)+
  facet_wrap(~decade, ncol=1)

GLODAP_map_year %>%
  filter(year > 1990) %>% 
  ggplot(aes(lon_grid, lat_grid, fill=log10(n)))+
  mapWorld+
  geom_raster()+
  scale_fill_viridis_c(option = "magma")+
  coord_quickmap(expand = FALSE)+
  facet_wrap(~year, ncol = 2)+
  theme(axis.title = element_blank(),
        axis.text = element_blank())


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