Last updated: 2021-07-03
Checks: 7 0
Knit directory: wildlife-bacteria/
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(20210129)
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 af6ad5b. 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: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.DS_Store
Ignored: analysis/_footer.html
Ignored: data/.DS_Store
Ignored: output/.DS_Store
Ignored: output/plots/.DS_Store
Ignored: output/plots/QC/.DS_Store
Ignored: output/plots/boxplots_select_taxa/.DS_Store
Ignored: output/plots/heatmaps/.DS_Store
Ignored: output/plots/maps/.DS_Store
Ignored: output/plots/tax_prev_abund/.DS_Store
Untracked files:
Untracked: ENA_docs/
Untracked: NCBI_data/
Untracked: data/dada2/
Untracked: data/dada2_tois/
Untracked: data/taxa_trees/
Untracked: data/tmp/
Untracked: output/beta-div-statistics.txt
Untracked: output/supp_table_pos.xlsx
Untracked: tmp/
Unstaged changes:
Modified: RData/amp_dec_bact.RData
Modified: RData/amp_raw_bact.RData
Modified: RData/ps_dec_bact.RData
Modified: RData/ps_raw_bact.RData
Modified: README.md
Deleted: analysis/site-map.Rmd
Deleted: analysis/tois.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/map.Rmd
) and HTML (docs/map.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 | af6ad5b | siobhon-egan | 2021-07-03 | general update |
ozmaps
Create map of study sites using ozmaps
package and associated data package for subdivision of regions.
Link to useful tutorial in the ggplot2 book here.
Load packages
#ozmaps data not on CRAN
#devtools::install_github("mdsumner/ozmaps.data")
pkgs <- c("ozmaps", "sf", "sp", "dplyr", "rgdal",
"raster", "ggplot2", "viridis", "readr",
"paletteer", "rmapshaper", "ggrepel",
"tidyverse", "ozmaps.data", "readxl")
lapply(pkgs, require, character.only = TRUE)
Import data
site_map <- read_excel("data/site_map.xlsx")
site_map_lab = column_to_rownames(site_map, var = "Site name")
Create large base map for Australia with study sites
oz_states <- ozmaps::ozmap_states
ggplot(oz_states) +
geom_sf() +
coord_sf()
oz_states <- ozmaps::ozmap_states %>% filter(NAME != "Other Territories")
oz_votes <- rmapshaper::ms_simplify(ozmaps::abs_ced)
ggplot() +
geom_sf(data = oz_states, mapping = aes(fill = NAME), show.legend = FALSE) +
geom_sf(data = oz_votes, fill = NA) +
coord_sf()
# large map
map1 = ggplot() +
geom_sf(data = oz_votes) +
geom_sf(data = oz_states, colour = "black", fill = "NA") +
geom_point(data = site_map_lab, mapping = aes(x = lon, y = lat, color = Site, shape=Site, size= 3)) +
coord_sf() + theme_classic() + theme(legend.position = "none", axis.title.x = element_blank(), axis.title.y = element_blank()) + xlim (114,155)
map1
Create insert maps for Perth and Sydney regions
# base map for inserts
map2 = ggplot() +
geom_sf(data = oz_votes) +
geom_sf(data = oz_states, colour = "black", fill = "NA") +
geom_point(data = site_map_lab, mapping = aes(x = lon, y = lat, color = Site, shape=Site, size= Size)) +
coord_sf() + theme_classic() + theme(legend.position = "none", axis.title.x = element_blank(), axis.title.y = element_blank())
# Sydney region
map3 = map2 + coord_sf(xlim = c(150, 152), ylim = c(-35, -33.0)) + theme(legend.position = "none") + theme(axis.title.x = element_blank(), axis.title.y = element_blank())
Coordinate system already present. Adding new coordinate system, which will replace the existing one.
map3
# Perth region
map4 = map2 + coord_sf(xlim = c(115, 117), ylim = c(-32.5, -31)) + theme(legend.position = "none") + theme(axis.title.x = element_blank(), axis.title.y = element_blank())
Coordinate system already present. Adding new coordinate system, which will replace the existing one.
map4
Save maps
ggsave("map_base.pdf", plot = map1, path = "output/plots", width = 30, height = 15, units = "cm")
ggsave("map_NSW.pdf", plot = map3, path = "output/plots", width = 10, height = 10, units = "cm")
ggsave("map_WA.pdf", plot = map4, path = "output/plots", width = 10, height = 10, units = "cm")
Capital cities for reference
oz_capitals <- tibble::tribble(
~city, ~lat, ~lon,
"Sydney", -33.8688, 151.2093,
"Melbourne", -37.8136, 144.9631,
"Brisbane", -27.4698, 153.0251,
"Adelaide", -34.9285, 138.6007,
"Perth", -31.9505, 115.8605,
"Hobart", -42.8821, 147.3272,
"Canberra", -35.2809, 149.1300,
"Darwin", -12.4634, 130.8456,
)
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] readxl_1.3.1 ozmaps.data_0.0.1 forcats_0.5.1 stringr_1.4.0
[5] purrr_0.3.4 tidyr_1.1.2 tibble_3.1.0 tidyverse_1.3.0
[9] ggrepel_0.9.1 rmapshaper_0.4.4 paletteer_1.3.0 readr_1.4.0
[13] viridis_0.5.1 viridisLite_0.3.0 ggplot2_3.3.3 raster_3.4-5
[17] rgdal_1.5-23 dplyr_1.0.5 sp_1.4-5 sf_0.9-7
[21] ozmaps_0.3.6 workflowr_1.6.2
loaded via a namespace (and not attached):
[1] fs_1.5.0 lubridate_1.7.10 httr_1.4.2 rprojroot_2.0.2
[5] tools_4.0.3 backports_1.2.1 bslib_0.2.4.9001 utf8_1.2.1
[9] R6_2.5.0 KernSmooth_2.23-18 lazyeval_0.2.2 rgeos_0.5-5
[13] DBI_1.1.1 colorspace_2.0-0 withr_2.4.1 tidyselect_1.1.0
[17] gridExtra_2.3 curl_4.3 compiler_4.0.3 git2r_0.28.0
[21] cli_2.3.1 rvest_0.3.6 geojsonsf_2.0.1 xml2_1.3.2
[25] sass_0.3.1 scales_1.1.1 classInt_0.4-3 digest_0.6.27
[29] foreign_0.8-81 rmarkdown_2.7.2 pkgconfig_2.0.3 htmltools_0.5.1.1
[33] highr_0.8 dbplyr_2.1.0 jsonvalidate_1.1.0 rlang_0.4.10
[37] rstudioapi_0.13 httpcode_0.3.0 jquerylib_0.1.3 generics_0.1.0
[41] farver_2.0.3 jsonlite_1.7.2 magrittr_2.0.1 Rcpp_1.0.6
[45] munsell_0.5.0 fansi_0.4.2 lifecycle_1.0.0 stringi_1.5.3
[49] whisker_0.4 yaml_2.2.1 jqr_1.2.0 oz_1.0-21
[53] maptools_1.0-2 grid_4.0.3 promises_1.2.0.1 geojsonio_0.9.4
[57] crayon_1.4.1 lattice_0.20-41 haven_2.3.1 geojson_0.3.4
[61] hms_1.0.0 knitr_1.31 pillar_1.5.1 geojsonlint_0.4.0
[65] codetools_0.2-18 crul_1.1.0 reprex_1.0.0 glue_1.4.2
[69] evaluate_0.14 V8_3.4.0 modelr_0.1.8 vctrs_0.3.7
[73] httpuv_1.5.5 cellranger_1.1.0 gtable_0.3.0 rematch2_2.1.2
[77] assertthat_0.2.1 xfun_0.21 broom_0.7.5 e1071_1.7-4
[81] later_1.1.0.1 class_7.3-18 units_0.7-0 ellipsis_0.3.1