Last updated: 2022-04-20
Checks: 7 0
Knit directory: bgc_argo_r_argodata/
This reproducible R Markdown analysis was created with workflowr (version 1.7.0). 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(20211008)
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 a2049e3. 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: .RData
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: output/
Untracked files:
Untracked: code/OceanSODA_argo_extremes.R
Untracked: code/creating_dataframe.R
Untracked: code/creating_map.R
Untracked: code/merging_oceanSODA_Argo.R
Untracked: code/pH_data_timeseries.R
Unstaged changes:
Modified: analysis/_site.yml
Modified: code/Workflowr_project_managment.R
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/oxygen_data.Rmd
) and HTML (docs/oxygen_data.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 | 8805f99 | pasqualina-vonlanthendinenna | 2022-04-11 | Build site. |
html | 905d82f | pasqualina-vonlanthendinenna | 2022-02-15 | Build site. |
html | b8a6482 | pasqualina-vonlanthendinenna | 2022-01-03 | Build site. |
html | 123e5db | pasqualina-vonlanthendinenna | 2021-12-07 | Build site. |
Rmd | f8abe59 | pasqualina-vonlanthendinenna | 2021-12-07 | suppressed output messages and updated plots |
html | 930ea26 | pasqualina-vonlanthendinenna | 2021-11-26 | Build site. |
html | e09c60b | pasqualina-vonlanthendinenna | 2021-11-26 | Build site. |
html | 1305d6b | pasqualina-vonlanthendinenna | 2021-11-26 | Build site. |
html | 5e2b8a5 | pasqualina-vonlanthendinenna | 2021-11-26 | Build site. |
html | 3df4daf | pasqualina-vonlanthendinenna | 2021-11-26 | Build site. |
html | 7a01367 | pasqualina-vonlanthendinenna | 2021-11-12 | Build site. |
Rmd | 59073c1 | pasqualina-vonlanthendinenna | 2021-11-12 | added NE Pacific oxygen |
html | 273ed2c | pasqualina-vonlanthendinenna | 2021-11-12 | Build site. |
Rmd | 06b6be7 | pasqualina-vonlanthendinenna | 2021-11-12 | added NE Pacific oxygen |
html | 284003d | pasqualina-vonlanthendinenna | 2021-11-11 | Build site. |
Rmd | fb668ef | pasqualina-vonlanthendinenna | 2021-11-11 | added oxygen data page |
Rmd | f7807db | pasqualina-vonlanthendinenna | 2021-11-11 | added oxygen data page |
Explore BGC-Argo oxygen data through timeseries and climatological maps
path_argo <- '/nfs/kryo/work/updata/bgc_argo_r_argodata'
path_emlr_utilities <- "/nfs/kryo/work/jenmueller/emlr_cant/utilities/files/"
Load in delayed-mode, adjusted oxygen data from the BGC-Argo synthetic profile files
path_argo_preprocessed <- paste0(path_argo, "/preprocessed_bgc_data")
oxy_merge <-
read_rds(file = paste0(path_argo_preprocessed, "/bgc_merge.rds")) %>%
select(
-c(nitrate_adjusted_error:ph_in_situ_total_adjusted_error),
-c(profile_nitrate_qc, profile_ph_in_situ_total_qc)
)
Focus on surface oxygen (top 10 m of the watercolumn) in the Southern Ocean, south of 30ºS
# select only best pH data (with QC flag 1) below 30ºS, for the top 10 m of the watercolumn
oxy_surface <- oxy_merge %>%
mutate(depth = swDepth(pres_adjusted, latitude = lat), .before = pres_adjusted) %>%
filter(doxy_adjusted_qc == '1', # keep only 'good' data
lat <= -30, # keep only data at or south of 30ºS
depth <= 10) %>% # keep only data above or at 10 m depth
mutate(
year = year(date), # separate the year and month from the date column
month = month(date), .after = n_prof
)
# check the correct latitudes, QC flags, and depth levels have been filtered
# max(oxy_surface$lat)
# min(oxy_surface$lat)
# table(oxy_surface$doxy_adjusted_qc)
# max(oxy_surface$depth)
# max(oxy_surface$date)
# min(oxy_surface$date)
Create a map of climatological monthly oxygen values, from January 2013 to August 2021, for the region south of 30ºS
# average oxygen values in the top 10 m for each month in each 2 x 2º longitude/latitude grid
oxy_mean <- oxy_surface %>%
group_by(lat, lon, month) %>%
summarise(oxy_ave_month = mean(doxy_adjusted))
# read in the map from updata
map <-
read_rds(paste(path_emlr_utilities,
"map_landmask_WOA18.rds",
sep = ""))
# map a monthly climatology of surface oxygen (Jan 2013 - September 2021)
map +
geom_tile(data = oxy_mean,
aes(lon, lat, fill = oxy_ave_month)) +
lims(y = c(-85, -25)) +
scale_fill_gradientn(colors = oceColorsJet(n = oxy_mean$oxy_ave_month)) +
labs(x = 'lon',
y = 'lat',
fill = 'dissolved oxygen \n(µmol kg-1)',
title = 'Monthly average surface dissolved oxygen values (Jan 2013-Sep 2021)') +
theme(legend.position = 'bottom')+
facet_wrap(~month)
Plot a timeseries of monthly-mean dissolved oxygen for the region south of 30ºS for the upper 10 m of the watercolumn
# plot a timeseries of monthly values over the whole southern ocean south of 30ºS
oxy_month <- oxy_surface %>%
group_by(year, month) %>%
summarise(oxy_ave = mean(doxy_adjusted))
# timeseries of monthly pH values over 2013-2021 (separate panels for each month)
oxy_month %>%
ggplot(aes(x = year, y = oxy_ave)) +
facet_wrap(~month) +
geom_line() +
geom_point() +
scale_x_continuous(breaks = seq(2013, 2021, 2))+
labs(x = 'year',
y = 'dissolved O2 (µmol kg-1)',
title = 'monthly mean dissolved oxygen (Jan 2013-Sep 2021, south of 30ºS)')
Monthly average dissolved oxygen, per year (January 2013 - December 2020; plotting only full years), over the whole region south of 30ºS
# timeseries of monthly oxygen values for each year (separate years on the same plot)
oxy_month %>%
filter(year != 2021) %>% # keep only years with full data
ggplot(aes(x = month, y = oxy_ave, group = year, col = as.character(year)))+
geom_line()+
geom_point()+
scale_x_continuous(breaks = seq(1, 12, 1))+
labs(x = 'month',
y = 'dissolved O2 (µmol kg-1)',
title = 'monthly mean dissolved oxygen (Jan 2013-Dec 2020, south of 30ºS)',
col = 'year')
Focus on surface oxygen (upper 10 m) in the north-east Pacific (10ºN - 70ºN, -190ºE, -140ºE)
# select only best oxygen data (with QC flag 1) between 10 and 70ºN, and 190 and 140ºW, for the top 10 m of the watercolumn
oxy_nepacific <- oxy_merge %>%
mutate(depth = swDepth(pres_adjusted, latitude = lat), .before = pres_adjusted) %>%
filter(doxy_adjusted_qc == '1', # keep only 'good' data
between(lat, 10, 70),
between(lon, 190, 240), # keep only data for the NE Pacific
depth <= 10) %>% # keep only data above or at 10 m depth
mutate(
year = year(date), # separate the year and month from the date column
month = month(date), .after = n_prof
)
# longitudes larger than -180ºE are lon-380
Create a map of climatological monthly surface oxygen values, in the north-east Pacific ocean (10ºN - 70ºN, -190ºE, -140ºE), for January 2013 - August 2021
# average oxygen values in the top 10 m for each month in each 2 x 2º longitude/latitude grid
oxy_mean_nepacific <- oxy_nepacific %>%
group_by(lat, lon, month) %>%
summarise(oxy_ave_month = mean(doxy_adjusted))
# map a monthly climatology of surface oxygen (Jan 2013 - August 2021)
map +
geom_tile(data = oxy_mean_nepacific,
aes(lon, lat, fill = oxy_ave_month)) +
lims(y = c(5, 60),
x = c(180, 250)) +
scale_fill_gradientn(colors = oceColorsJet(n = oxy_mean_nepacific$oxy_ave_month)) +
labs(x = 'lon',
y = 'lat',
fill = 'dissolved oxygen \n(µmol kg-1)',
title = 'Monthly average surface dissolved oxygen (Jan 2013-Aug 2021)') +
theme(legend.position = 'right')+
facet_wrap(~month)
Timeseries of monthly mean oxygen for the northeast Pacific from January 2013 to August 2021
# plot a timeseries of monthly values over the whole NE Pacific
oxy_month_nepacific <- oxy_nepacific %>%
group_by(year, month) %>%
summarise(oxy_ave = mean(doxy_adjusted))
# timeseries of monthly pH values over 2013-2021 (separate panels for each month)
oxy_month_nepacific %>%
ggplot(aes(x = year, y = oxy_ave)) +
facet_wrap(~month) +
geom_line() +
geom_point() +
scale_x_continuous(breaks = seq(2013, 2021, 2))+
labs(x = 'year',
y = 'dissolved O2 (µmol kg-1)',
title = 'monthly mean dissolved oxygen (Jan 2013-Aug 2021, NE Pacific)')
Timeseries of monthly surface oxygen, per year, in the NE Pacific
# timeseries of monthly oxygen values for each year (separate years on the same plot)
oxy_month_nepacific %>%
filter(year != 2021) %>% # keep only years with full data
ggplot(aes(x = month, y = oxy_ave, group = year, col = as.character(year)))+
geom_line()+
geom_point()+
scale_x_continuous(breaks = seq(1, 12, 1))+
labs(x = 'month',
y = 'dissolved O2 (µmol kg-1)',
title = 'monthly mean dissolved oxygen (Jan 2013-Dec 2020, NE Pacific)',
col = 'year')
sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: openSUSE Leap 15.3
Matrix products: default
BLAS: /usr/local/R-4.1.2/lib64/R/lib/libRblas.so
LAPACK: /usr/local/R-4.1.2/lib64/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] oce_1.5-0 gsw_1.0-6 lubridate_1.8.0 argodata_0.1.0
[5] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4
[9] readr_2.1.1 tidyr_1.1.4 tibble_3.1.6 ggplot2_3.3.5
[13] tidyverse_1.3.1 workflowr_1.7.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.8 getPass_0.2-2 ps_1.6.0 assertthat_0.2.1
[5] rprojroot_2.0.2 digest_0.6.29 utf8_1.2.2 R6_2.5.1
[9] cellranger_1.1.0 backports_1.4.1 reprex_2.0.1 evaluate_0.14
[13] highr_0.9 httr_1.4.2 pillar_1.6.4 rlang_0.4.12
[17] readxl_1.3.1 rstudioapi_0.13 whisker_0.4 callr_3.7.0
[21] jquerylib_0.1.4 rmarkdown_2.11 labeling_0.4.2 munsell_0.5.0
[25] broom_0.7.11 compiler_4.1.2 httpuv_1.6.5 modelr_0.1.8
[29] xfun_0.29 pkgconfig_2.0.3 htmltools_0.5.2 tidyselect_1.1.1
[33] fansi_1.0.2 crayon_1.4.2 tzdb_0.2.0 dbplyr_2.1.1
[37] withr_2.4.3 later_1.3.0 grid_4.1.2 jsonlite_1.7.3
[41] gtable_0.3.0 lifecycle_1.0.1 DBI_1.1.2 git2r_0.29.0
[45] magrittr_2.0.1 scales_1.1.1 cli_3.1.1 stringi_1.7.6
[49] farver_2.1.0 fs_1.5.2 promises_1.2.0.1 xml2_1.3.3
[53] bslib_0.3.1 ellipsis_0.3.2 generics_0.1.1 vctrs_0.3.8
[57] tools_4.1.2 glue_1.6.0 RNetCDF_2.5-2 hms_1.1.1
[61] processx_3.5.2 fastmap_1.1.0 yaml_2.2.1 colorspace_2.0-2
[65] rvest_1.0.2 knitr_1.37 haven_2.4.3 sass_0.4.0