knitr::opts_chunk$set(echo = T) library(dplyr) library(ggplot2)
Download from Zenodo (https://zenodo.org/record/166725)
zip_download_dest <- "~/Documents/sad-comparison.zip" download.file("https://zenodo.org/record/166725/files/weecology/sad-comparison-peerj.2.zip?download=1",zip_download_dest , quiet = TRUE, mode = "wb") unzip("~/Documents/sad-comparison.zip", exdir = "~/Documents/sad-comparison") file.remove(zip_download_dest)
Load data files from Zenodo downloads
zenodo_dir <- list.dirs("~/Documents/sad-comparison/", full.names = T) zenodo_dir <- zenodo_dir[ which(grepl("sad-data", zenodo_dir))]
BBS:
bbs_zenodo <- read.csv(file.path(zenodo_dir, "bbs_spab.csv"), stringsAsFactors = F, header = F, skip = 2) bbs_github <- read.csv(here::here("working-data", "abund_data", "bbs_spab.csv"), stringsAsFactors = F, header = F, skip = 2) any(!(bbs_github == bbs_zenodo))
FIA:
fia_zenodo <- read.csv(file.path(zenodo_dir, "fia_spab.csv"), stringsAsFactors = F, header = F, skip = 2) fia_github <- read.csv(here::here("working-data", "abund_data", "fia_spab.csv"), stringsAsFactors = F, header = F, skip = 2) any(!(fia_github == fia_zenodo))
Gentry:
gentry_zenodo <- read.csv(file.path(zenodo_dir, "gentry_spab.csv"), stringsAsFactors = F, header = F, skip = 2) gentry_github <- read.csv(here::here("working-data", "abund_data", "gentry_spab.csv"), stringsAsFactors = F, header = F, skip = 2) any(!(gentry_github == gentry_zenodo), na.rm = T) any(!(which(is.na(gentry_github)) == which(is.na(gentry_zenodo))))
MCDB:
mcdb_zenodo <- read.csv(file.path(zenodo_dir, "mcdb_spab.csv"), stringsAsFactors = F, header = F, skip = 2) mcdb_github <- read.csv(here::here("working-data", "abund_data", "mcdb_spab.csv"), stringsAsFactors = F, header = F, skip = 2) any(!(mcdb_github == mcdb_zenodo))
All the data files downloaded from GitHub exactly match their counterparts on Zenodo. (This is not surprising but good to check).
The analyses for this manuscript were done using the files downloaded from GitHub. RMD doesn't think it's necessary (or really appropriate) to re-write download_data
to download from Zenodo instead. This report demonstrates that the analyses should be replicable using the data files from Zenodo, should that be the only/the preferred option in the future.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.