From b8ef9274ab6b4d2d753b6f09ca5e0ef53fcf9030 Mon Sep 17 00:00:00 2001 From: gmyenni Date: Thu, 19 Sep 2024 02:57:46 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20weecolog?= =?UTF-8?q?y/portalr@6597af022f3a385585ae0cb1b87a6906f17028bc=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/rodent-abundance-demo.html | 2 +- pkgdown.yml | 2 +- search.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/articles/rodent-abundance-demo.html b/articles/rodent-abundance-demo.html index f33d571..1ac6366 100644 --- a/articles/rodent-abundance-demo.html +++ b/articles/rodent-abundance-demo.html @@ -117,7 +117,7 @@

Retrieving the Data
 portal_data_path <- tempdir() # use a temporary folder to store downloaded data
 data_tables <- load_rodent_data(portal_data_path, download_if_missing = TRUE)
-#> Warning in load_datafile(file.path("Rodents", "Portal_rodent.csv"), na.strings = "", : Proceeding to download data into specified path/tmp/RtmpznAHm8
+#> Warning in load_datafile(file.path("Rodents", "Portal_rodent.csv"), na.strings = "", : Proceeding to download data into specified path/tmp/Rtmp3p4Eap
 #> Downloading version `5.102.0` of the data...
 #> Loading in data version 5.102.0

The load_rodent_data function reads in several tables diff --git a/pkgdown.yml b/pkgdown.yml index e4beea9..6ff2894 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: portal_researcher_examples: portal_researcher_examples.html rodent-abundance-demo: rodent-abundance-demo.html -last_built: 2024-09-19T01:37Z +last_built: 2024-09-19T02:56Z urls: reference: https://weecology.github.io/portalr/reference article: https://weecology.github.io/portalr/articles diff --git a/search.json b/search.json index 36aa4be..b112ccf 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Code of Conduct","text":"interest fostering open welcoming environment, contributors maintainers pledge making participation project community harassment-free experience everyone, regardless age, body size, disability, ethnicity, gender identity expression, level experience, nationality, personal appearance, race, religion, sexual identity orientation.","code":""},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Code of Conduct","text":"Examples behavior contributes creating positive environment include: Using welcoming inclusive language respectful differing viewpoints experiences Gracefully accepting constructive criticism Focusing best community Showing empathy towards community members Examples unacceptable behavior participants include: use sexualized language imagery unwelcome sexual attention advances Trolling, insulting/derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical electronic address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"our-responsibilities","dir":"","previous_headings":"","what":"Our Responsibilities","title":"Contributor Code of Conduct","text":"Project maintainers responsible clarifying standards acceptable behavior expected take appropriate fair corrective action response instances unacceptable behavior. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, ban temporarily permanently contributor behaviors deem inappropriate, threatening, offensive, harmful.","code":""},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Code of Conduct","text":"Code Conduct applies within project spaces public spaces individual representing project community. Examples representing project community include using official project e-mail address, posting via official social media account, acting appointed representative online offline event. Representation project may defined clarified project maintainers.","code":""},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported contacting project team ethan@weecology.org. complaints reviewed investigated result response deemed necessary appropriate circumstances. project team obligated maintain confidentiality regard reporter incident. details specific enforcement policies may posted separately. Project maintainers follow enforce Code Conduct good faith may face temporary permanent repercussions determined members project’s leadership.","code":""},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 1.4, available https://www.contributor-covenant.org/version/1/4/code--conduct.html","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"guidelines-for-contributing","dir":"","previous_headings":"","what":"Guidelines for Contributing","title":"NA","text":"Thanks checking project! haven’t already, please check readme general info project.","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"contributor-code-of-conduct","dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"NA","text":"contributors expected follow code conduct.","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"for-the-general-public","dir":"","previous_headings":"","what":"For the General Public","title":"NA","text":"’re member Weecology lab, ask use one following two methods contributing: Create issue – spot typos, bugs, general suggestions, etc. can also use participate ongoing discussions. info, please check Github guide. Fork create pull request – suggested bugfixes changes. info, please check Github guide. ask follow guidelines documentation testing.","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"weecologists","dir":"","previous_headings":"For the General Public","what":"Weecologists","title":"NA","text":"’re actively working repo, write access create branches new features bugfixes. Please see lab-wiki info using branches shared repository. don’t write access like , please contact @gmyenni access.","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"documentation","dir":"","previous_headings":"For the General Public","what":"Documentation","title":"NA","text":"contributing code project, generally don’t need additional packages, since documentation written comments R scripts. also building package, see section details. cases, ’ll creating new function documenting . can check existing functions examples, ’s basic template: Note can also include links functions, math formatting, . details, see chapter documentation Hadley Wickham’s book R packages.","code":"#' @title {this is the heading for the help file} #' #' @description {A description of the function} #' #' @param {name of a function argument} {what the argument does} #' @return {what is returned from the function} #' @examples #' {R code that is an example use of the function} #' @export #' newfunc <- function() ..."},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"testing","dir":"","previous_headings":"For the General Public","what":"Testing","title":"NA","text":"adding new functionality, please include automated tests verify basic functionality correct. Automated testing uses R scripts, live tests/testthat/ subfolder package. adding new file, please name test-{concept}.R. general rule, don’t need test possible inputs outputs function, test important aspects: * outputs correct format (including dimensions components) * sample input produces correct sample output can see existing tests examples organize tests, note several different kinds expect_ functions test different things. details, see chapter testing Hadley Wickham’s book R packages.","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"building","dir":"","previous_headings":"For the General Public","what":"Building","title":"NA","text":"fully build package, including documentation, running-tests, need roxygen2, testthat, devtools package. Specific operations done calling appropriate functions within R, working directory somewhere package folder. suggested workflow : 1. Write code, documentation, tests. 2. Run devtools::document() generate documentation files update NAMESPACE file. 3. Run devtools::install() install new version package. 4. Run devtools::test() run test scripts new version package. also prepping package whole, also want run devtools::check() /devtools::check_cran() make sure package complete. info, see GitHub repo devtools package.","code":""},{"path":"https://weecology.github.io/portalr/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2018 Weecology Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Examples of How Portal Researchers Are Using the Package","text":"portalr package started series scripts used Portal researchers quickly consistently summarize Portal data. developed formalized package, dealing quirky data manipulation hood. Now, researchers currently collecting data Portal started actively using package work. examples using package included .","code":""},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"installing-the-package","dir":"Articles","previous_headings":"Introduction","what":"Installing the Package","title":"Examples of How Portal Researchers Are Using the Package","text":"First, need install portalr package haven’t done already. ’ll also load tidyverse, many packages data manipulation plotting.","code":"#devtools::install_github(\"weecology/portalr\") library(portalr) library(dplyr) library(tidyr) library(ggplot2)"},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"rodent-biomass-ratios-between-plot-treatment-types","dir":"Articles","previous_headings":"","what":"Rodent Biomass Ratios between Plot Treatment Types","title":"Examples of How Portal Researchers Are Using the Package","text":"One thing can Portal rodent data look ratio biomass control plots kangaroo rat exclosure plots changed time.","code":""},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"getting-the-data-we-want","dir":"Articles","previous_headings":"Rodent Biomass Ratios between Plot Treatment Types","what":"Getting the Data We Want","title":"Examples of How Portal Researchers Are Using the Package","text":"going compare biomass plot types, need know biomass plot. achieve , can set level = \"plot\" Note path argument summarize_rodent_data function set “repo.” can choose download Portal data onto local computer load data R, can also get data directly GitHub repository setting path = \"repo\" ’ve done . data structure look like , columns date, treatment, plot number, species:","code":"biomass_data <- portalr::summarize_rodent_data(path = \"repo\", level = \"plot\", output = \"biomass\", time = \"date\")"},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"working-with-the-data","dir":"Articles","previous_headings":"Rodent Biomass Ratios between Plot Treatment Types","what":"Working with the Data","title":"Examples of How Portal Researchers Are Using the Package","text":"Let’s select rows want: Based information plot treatment switches can found Readme file PortalData repo, want select censuses years 1988-2014; make data bit easier work , can also split date column three separate columns filter year column. Since comparing control plots exclosure plots, can also filter treatment types. can get total biomass plot per census summing mass species per row. , sum year treatment type. , can create exclosure:control ratio.","code":"biomass_data <- biomass_data %>% # split the date column into year, month, and day separate(col = censusdate, into = c(\"year\", \"month\", \"day\"), sep = \"-\") %>% filter(year >= 1988 & year < 2015, # filter by year treatment == \"control\" | treatment == \"exclosure\") # filter by treatment type # compute total biomass per year and treatment biomass_total <- biomass_data %>% gather(species, biomass, BA:SO) %>% group_by(year, treatment) %>% summarize(totals = sum(biomass, na.rm = TRUE)) # make a column with the exclosure:control ratio biomass_ratio <- biomass_total %>% spread(treatment, totals) %>% mutate(EX_to_CO_ratio = exclosure / control) %>% ungroup()"},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"plotting-the-ratios","dir":"Articles","previous_headings":"Rodent Biomass Ratios between Plot Treatment Types","what":"Plotting the Ratios","title":"Examples of How Portal Researchers Are Using the Package","text":"can finally plot data! mid-1990s, biomass kangaroo rat exclosures never went 50% biomass found control plots; small granivores just couldn’t keep larger kangaroo rats. larger pocket mouse, Chaetodipus baileyi, showed system (first gray bar), found primarily kangaroo rat exclosures. increased biomass ratio 80% found control plots. C. baileyi left system (second gray bar), ratio returned similar levels arrival.","code":""},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"working-with-plant-data","dir":"Articles","previous_headings":"","what":"Working with Plant Data","title":"Examples of How Portal Researchers Are Using the Package","text":"rodent community data frequently utilized data Portal Project, can also use portalr get plant ant data site. ’ve running multivariate statistics plant composition plots looking differences rodent treatment types. get data need .","code":""},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"getting-the-data-we-want-1","dir":"Articles","previous_headings":"Working with Plant Data","what":"Getting the Data We Want","title":"Examples of How Portal Researchers Are Using the Package","text":"site two rainy periods , therefore, two communities annual plants. Let’s say want take look abundance winter annuals system, want see differ treatment type. can use summarize_plant_data function get appropriate data. arguments mean? , path = 'repo' pulls data directly online repository. level = 'plot' indicates want data summarized plot level rather across entire site, type = 'winter-annual' give us annual species can found winter months. Sometimes past, misidentified species plant; correct_sp = TRUE goes data corrects species name now know correct species. times, just don’t know species , unknown; don’t want included, use unknown = FALSE. Finally, want abundance species returned. Unlike rodent abundance, however, ’ve asked flat shape, data structure long format look like : Wait second! Didn’t ask winter annuals? first rows summer plant census? turns , two annual communities plants, annuals system can found summer winter. Hypothetically, someone might want know annual plants found winter: many show summer, example? get data want–just winter annuals found winter season–just need one quick line code. ’s like ! Now data want run multivariate statistics whatever else might want data.","code":"plant_data <- portalr::summarize_plant_data(path = 'repo', level = 'plot', type = 'winter-annual', correct_sp = TRUE, unknowns = FALSE, shape = 'flat', output = 'abundance') plant_data_winter <- dplyr::filter(plant_data, season == 'winter')"},{"path":[]},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Portal Rodent Abundance Demo","text":"vignette basic guide begin exploring Portal data. load data (making sure ’re using recent copy GitHub), explore rodent abundances time, comparison “control” “kangaroo rat exclosure” treatments.","code":""},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"package-setup","dir":"Articles","previous_headings":"Introduction","what":"Package Setup","title":"Portal Rodent Abundance Demo","text":"First load several packages: tidyverse contains several packages data manipulation plotting. cowplot contains nicer default theme ggplot. portalr package, contains functions read Portal data basic processing.","code":"library(dplyr) library(tidyr) library(ggplot2) library(cowplot) library(portalr)"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"retrieving-the-data","dir":"Articles","previous_headings":"","what":"Retrieving the Data","title":"Portal Rodent Abundance Demo","text":"Note package contain actual Portal data, resides online GitHub repository. First, try load data. isn’t Portal folder, load_rodent_data fall back downloading data, well. check whether already data. don’t data, version isn’t recent, use download_observations function download latest copy data. load_rodent_data function reads several tables related rodent abundances. won’t necessarily use tables, loading now gives us access later.","code":"portal_data_path <- tempdir() # use a temporary folder to store downloaded data data_tables <- load_rodent_data(portal_data_path, download_if_missing = TRUE) #> Warning in load_datafile(file.path(\"Rodents\", \"Portal_rodent.csv\"), na.strings = \"\", : Proceeding to download data into specified path/tmp/RtmpznAHm8 #> Downloading version `5.102.0` of the data... #> Loading in data version 5.102.0 print(summary(data_tables)) #> Length Class Mode #> rodent_data 31 data.frame list #> species_table 15 data.frame list #> trapping_table 8 data.frame list #> newmoons_table 4 data.frame list #> plots_table 6 data.frame list"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"rodent-abundances","dir":"Articles","previous_headings":"","what":"Rodent Abundances","title":"Portal Rodent Abundance Demo","text":"first table loaded (data_tables$rodent_data) record whatever found traps, mostly rodents, also taxa. just wanted get rodent abundance data, use abundance function, default arguments filter non-rodents. Let’s convert data long format easier facetting. Also, want scientific names instead two-letter species codes, let’s matching, :","code":"# get rodent abundance by plot rodent_abundance_by_plot <- abundance(path = portal_data_path, time = \"date\", level = \"plot\") #> Loading in data version 5.102.0 rodent_abundance <- rodent_abundance_by_plot %>% gather(species, abundance, -censusdate, -treatment, -plot) %>% count(species, censusdate, wt = abundance) %>% rename(abundance = n) print(summary(rodent_abundance)) #> species censusdate abundance #> Length:9513 Min. :1979-09-22 Min. : 0.000 #> Class :character 1st Qu.:1989-12-04 1st Qu.: 0.000 #> Mode :character Median :1999-06-12 Median : 0.000 #> Mean :2000-05-21 Mean : 6.897 #> 3rd Qu.:2010-09-05 3rd Qu.: 5.000 #> Max. :2023-06-20 Max. :334.000 join_scientific_name <- function(rodent_abundance, species_table = data_tables$species_table) { return(rodent_abundance %>% left_join(select(species_table, \"species\", \"scientificname\"), by = \"species\") %>% rename(scientific_name = scientificname) ) } rodent_abundance <- join_scientific_name(rodent_abundance)"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"figure-abundance-over-time","dir":"Articles","previous_headings":"Rodent Abundances","what":"Figure: abundance over time","title":"Portal Rodent Abundance Demo","text":"Monthly abundance rodents (plots)","code":"make_abundance_plot_over_time <- function(rodent_abundance) { return(ggplot(rodent_abundance, aes(x = censusdate, y = abundance)) + geom_line() + facet_wrap(~scientific_name, scales = \"free_y\", ncol = 3) + xlab(\"Date\") + ylab(\"Abundance\") + scale_x_date(breaks = seq(as.Date(\"1977-01-01\"), to = as.Date(\"2018-01-01\"), \"+5 years\"), date_labels = \"%Y\", limits = as.Date(c(\"1977-01-01\", \"2018-01-01\"))) + theme_cowplot() + theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5), legend.position = \"bottom\", legend.justification = \"center\", strip.text.x = element_text(size = 10)) ) } my_plot <- make_abundance_plot_over_time(rodent_abundance) print(my_plot) #> Warning: Removed 41 rows containing missing values or values outside the scale range #> (`geom_line()`)."},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"next-steps","dir":"Articles","previous_headings":"Rodent Abundances","what":"Next Steps","title":"Portal Rodent Abundance Demo","text":"next steps likely dig deeper rodent abundances different treatments, first want know different treatments look like, let’s revisit abundances later.","code":""},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"plot-treatments","dir":"Articles","previous_headings":"","what":"Plot Treatments","title":"Portal Rodent Abundance Demo","text":"description experimental design treatments can found Readme file PortalDate repo. now, just going use Portal_plots table file look treatments individual plots changed time. Note file already loaded plots_table loadData function ran previously. want proper date variable well converting plot factor:","code":"print(summary(data_tables$plots_table)) #> year month plot treatment #> Min. :1977 Min. : 1.000 Min. : 1.00 Length:11576 #> 1st Qu.:1988 1st Qu.: 4.000 1st Qu.: 6.00 Class :character #> Median :1999 Median : 7.000 Median :12.00 Mode :character #> Mean :1999 Mean : 6.536 Mean :12.49 #> 3rd Qu.:2010 3rd Qu.:10.000 3rd Qu.:18.00 #> Max. :2023 Max. :12.000 Max. :24.00 #> resourcetreatment anttreatment #> Length:11576 Length:11576 #> Class :character Class :character #> Mode :character Mode :character #> #> #> plot_treatments <- data_tables$plots_table %>% mutate(iso_date = as.Date(paste0(year, \"-\", month, \"-\", \"01\")), plot = as.factor(plot)) %>% select(iso_date, plot, treatment)"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"figure-plot-treatments-over-time","dir":"Articles","previous_headings":"Plot Treatments","what":"Figure: plot treatments over time","title":"Portal Rodent Abundance Demo","text":"Treatments Plots Date","code":"my_plot <- ggplot(plot_treatments, aes(x = iso_date, y = treatment, color = treatment)) + geom_point(shape = 20) + geom_vline(aes(xintercept = as.Date(\"1977-10-01\")), linetype = 2) + geom_vline(aes(xintercept = as.Date(\"1988-01-01\")), linetype = 2) + geom_vline(aes(xintercept = as.Date(\"2005-01-01\")), linetype = 2) + geom_vline(aes(xintercept = as.Date(\"2015-04-01\")), linetype = 2) + facet_wrap(~plot, ncol = 4) + xlab(\"Date\") + ylab(\"Treatment\") + scale_color_manual(values = rainbow(4)) + scale_x_date(breaks = seq(as.Date(\"1977-01-01\"), to = as.Date(\"2018-01-01\"), \"+5 years\"), date_labels = \"%Y\") + theme_cowplot() + guides(color = \"none\") + theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)) print(my_plot)"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"identifying-control-plots","dir":"Articles","previous_headings":"Plot Treatments","what":"Identifying control plots","title":"Portal Rodent Abundance Demo","text":"treatments plots changed time: cases, due initial ramping experimental protocol, others, exclusions Dipodomys spectabilis started converted back later species went locally extinct (e.g. plots 1, 5, 9, 24).","code":""},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"which-plots-have-always-been-control-plots","dir":"Articles","previous_headings":"Plot Treatments > Identifying control plots","what":"Which plots have always been control plots?","title":"Portal Rodent Abundance Demo","text":"Note, however, excludes several plots treatment changed ~2015. can include plots first filtering date testing “control” treatment: identify datespan plots controls:","code":"always_control_plots <- plot_treatments %>% group_by(plot) %>% summarize(always_control = all(treatment == \"control\")) %>% filter(always_control) print(always_control_plots) #> # A tibble: 4 × 2 #> plot always_control #> #> 1 4 TRUE #> 2 11 TRUE #> 3 14 TRUE #> 4 17 TRUE mostly_control_plots <- plot_treatments %>% filter(iso_date < \"2015-01-01\") %>% group_by(plot) %>% summarize(mostly_control = all(treatment == \"control\")) %>% filter(mostly_control) print(mostly_control_plots) #> # A tibble: 8 × 2 #> plot mostly_control #> #> 1 2 TRUE #> 2 4 TRUE #> 3 8 TRUE #> 4 11 TRUE #> 5 12 TRUE #> 6 14 TRUE #> 7 17 TRUE #> 8 22 TRUE date_span <- plot_treatments %>% filter(plot %in% mostly_control_plots$plot) %>% group_by(iso_date) %>% summarize(all_control = all(treatment == \"control\")) %>% filter(all_control) print(date_span) #> # A tibble: 411 × 2 #> iso_date all_control #> #> 1 1977-07-01 TRUE #> 2 1977-08-01 TRUE #> 3 1977-09-01 TRUE #> 4 1977-10-01 TRUE #> 5 1977-11-01 TRUE #> 6 1977-12-01 TRUE #> 7 1978-01-01 TRUE #> 8 1978-02-01 TRUE #> 9 1978-03-01 TRUE #> 10 1978-04-01 TRUE #> # ℹ 401 more rows"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"abundances-over-control-plots","dir":"Articles","previous_headings":"Plot Treatments","what":"Abundances over control plots","title":"Portal Rodent Abundance Demo","text":"now ready plot abundances just control plots time span 1977-07-01 2015-03-01. retrieving abundance data plot, filtering accordingly: Monthly abundance rodents (control plots)","code":"rodent_abundance_by_plot %>% filter(censusdate >= min(date_span$iso_date), censusdate <= max(date_span$iso_date), plot %in% mostly_control_plots$plot) %>% select(-treatment, -plot) %>% gather(species, abundance, -censusdate) %>% count(censusdate, species, wt = abundance) %>% rename(abundance = n) %>% join_scientific_name() %>% {.} -> rodent_abundance_control rodent_abundance_control %>% make_abundance_plot_over_time() %>% print()"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"abundances-over-rodent-exclosures","dir":"Articles","previous_headings":"Plot Treatments","what":"Abundances over rodent exclosures","title":"Portal Rodent Abundance Demo","text":"can “exclosure” condition. First, plots: , datespan: Finally, figure: Monthly abundance rodents (exclosure plots) Since data number plots previous figure, can directly compare abundances. Note decreased numbers kangaroo rats (Dipodomys spp.) increased numbers taxa.","code":"mostly_exclosure_plots <- plot_treatments %>% filter(iso_date > as.Date(\"1989-01-01\"), iso_date < \"2015-01-01\") %>% group_by(plot) %>% summarize(mostly_exclosure = all(treatment == \"exclosure\")) %>% filter(mostly_exclosure) print(mostly_exclosure_plots) #> # A tibble: 8 × 2 #> plot mostly_exclosure #> #> 1 3 TRUE #> 2 6 TRUE #> 3 13 TRUE #> 4 15 TRUE #> 5 18 TRUE #> 6 19 TRUE #> 7 20 TRUE #> 8 21 TRUE date_span <- plot_treatments %>% filter(plot %in% mostly_exclosure_plots$plot) %>% group_by(iso_date) %>% summarize(all_exclosure = all(treatment == \"exclosure\")) %>% filter(all_exclosure) print(date_span) #> # A tibble: 297 × 2 #> iso_date all_exclosure #> #> 1 1988-01-01 TRUE #> 2 1988-02-01 TRUE #> 3 1988-03-01 TRUE #> 4 1988-04-01 TRUE #> 5 1988-05-01 TRUE #> 6 1988-06-01 TRUE #> 7 1988-07-01 TRUE #> 8 1988-08-01 TRUE #> 9 1988-09-01 TRUE #> 10 1988-10-01 TRUE #> # ℹ 287 more rows rodent_abundance_by_plot %>% filter(censusdate >= min(date_span$iso_date), censusdate <= max(date_span$iso_date), plot %in% mostly_exclosure_plots$plot) %>% select(-treatment, -plot) %>% gather(species, abundance, -censusdate) %>% count(censusdate, species, wt = abundance) %>% rename(abundance = n) %>% join_scientific_name() %>% {.} -> rodent_abundance_exclosure rodent_abundance_exclosure %>% make_abundance_plot_over_time() %>% print()"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"comparison-figure","dir":"Articles","previous_headings":"Plot Treatments","what":"Comparison Figure","title":"Portal Rodent Abundance Demo","text":"Let’s merge two datasets produce combined plot: Monthly abundance rodents (control vs. exclosure plots) expected, substantially lower counts kangaroo rats (Dipodomys spp.) “exclosure” plots. also observe similar abundances species, increases others (e.g. “Chaetodipus baileyi”, “Perognathus flavus”, “Reithrodontomys megalotis”)","code":"rodent_abundance_merged <- bind_rows( mutate(rodent_abundance_control, treatment = \"control\"), mutate(rodent_abundance_exclosure, treatment = \"exclosure\")) merged_plot <- ggplot(rodent_abundance_merged, aes(x = censusdate, y = abundance, color = treatment)) + geom_line() + facet_wrap(~scientific_name, scales = \"free_y\", ncol = 3) + xlab(\"Date\") + ylab(\"Abundance\") + scale_x_date(breaks = seq(as.Date(\"1977-01-01\"), to = as.Date(\"2018-01-01\"), \"+5 years\"), date_labels = \"%Y\", limits = as.Date(c(\"1977-01-01\", \"2018-01-01\"))) + scale_color_manual(values = c(\"purple\", \"yellow\")) + theme_cowplot() + theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5), legend.position = \"bottom\", legend.justification = \"center\", strip.text.x = element_text(size = 10)) print(merged_plot)"},{"path":"https://weecology.github.io/portalr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Glenda M. Yenni. Author, maintainer. Hao Ye. Author. Erica M. Christensen. Author. Juniper L. Simonis. Author. Ellen K. Bledsoe. Author. Renata M. Diaz. Author. Shawn D. Taylor. Author. Ethan P, White. Author. S.K. Morgan Ernest. Author. Weecology. Copyright holder.","code":""},{"path":"https://weecology.github.io/portalr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Erica M. Christensen, Glenda M. Yenni, Hao Ye, Juniper L. Simonis, Ellen K. Bledsoe, Renata M. Diaz, Shawn D. Taylor, Ethan P. White, S. K. Morgan Ernest. (2019). portalr: R package summarizing using Portal Project Data. Journal Open Source Software, 4(33), 1098, https://doi.org/10.21105/joss.01098","code":"@Article{christensen2019portalr, title = {portalr: an R package for summarizing and using the Portal Project Data}, author = {Erica M. Christensen and Glenda M. Yenni and Hao Ye and Juniper L. Simonis and Ellen K. Bledsoe and Renata M. Diaz and Shawn D. Taylor and Ethan P. White and S. K. Morgan Ernest}, year = {2019}, journal = {Journal of Open Source Software}, volume = {4}, number = {33}, pages = {1098}, doi = {10.21105/joss.01098}, }"},{"path":[]},{"path":"https://weecology.github.io/portalr/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Create Useful Summaries of the Portal Data","text":"portalr package provides collection basic functions summarize Portal project data rodents, plants, ants, weather long-term field site Chihuahuan Desert. data begin 1977 continuously updated today. functions summarize rodent abundance, biomass, energy site, plot, treatment type. functions summarize weather data collected automated weather stations plant data collected summer fall.","code":""},{"path":"https://weecology.github.io/portalr/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Create Useful Summaries of the Portal Data","text":"can install portalr CRAN : github :","code":"install.packages(\"portalr\") # install.packages(\"remotes\") remotes::install_github(\"weecology/portalr\")"},{"path":"https://weecology.github.io/portalr/index.html","id":"examples","dir":"","previous_headings":"","what":"Examples","title":"Create Useful Summaries of the Portal Data","text":"Load data tables PortalData GitHub repo: Download generate summaries rodent abundance biomass: Retrieve weather data: detailed info, checkout vignettes associated package:","code":"data_tables <- load_rodent_data(\"repo\") download_observations(\".\") rodent_data <- abundance(\".\") # default grouping is by sampling period rodent_biomass_by_plot <- biomass(\".\", level = \"plot\", type = \"granivores\", shape = \"flat\", time = \"date\") weatherdata <- weather(\"Monthly\", \".\") browseVignettes(\"portalr\")"},{"path":[]},{"path":"https://weecology.github.io/portalr/index.html","id":"portal-data-repo","dir":"","previous_headings":"More Information","what":"Portal Data Repo","title":"Create Useful Summaries of the Portal Data","text":"data repo contains useful details issues data collection, background handle way . course, also contains raw data, like create complex data summaries provided .","code":""},{"path":"https://weecology.github.io/portalr/index.html","id":"the-portal-project","dir":"","previous_headings":"More Information","what":"The Portal Project","title":"Create Useful Summaries of the Portal Data","text":"Find list previous publications using Portal data website.","code":""},{"path":"https://weecology.github.io/portalr/index.html","id":"the-portal-blog","dir":"","previous_headings":"More Information","what":"The Portal Blog","title":"Create Useful Summaries of the Portal Data","text":"Follow blog get latest news happening project site.","code":""},{"path":"https://weecology.github.io/portalr/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Create Useful Summaries of the Portal Data","text":"cite portalr, please refer either: JOSS publication: Erica M. Christensen, Glenda M. Yenni, Hao Ye, Juniper L. Simonis, Ellen K. Bledsoe, Renata M. Diaz, Shawn D. Taylor, Ethan P. White, S. K. Morgan Ernest. (2019). portalr: R package summarizing using Portal Project Data. Journal Open Source Software, 4(33), 1098, https://doi.org/10.21105/joss.01098 use recent release Zenodo.","code":""},{"path":"https://weecology.github.io/portalr/index.html","id":"dataset-citation","dir":"","previous_headings":"Citation","what":"Dataset Citation","title":"Create Useful Summaries of the Portal Data","text":"cite Portal dataset, use:","code":"get_dataset_citation() #> #> To cite the Portal Data in publications, use: #> #> S. K. Morgan Ernest, Glenda M. Yenni, Ginger Allington, Ellen K. #> Bledsoe, Erica M. Christensen, Renata M. Diaz, Keith Geluso, Jacob R. #> Goheen, Qinfeng Guo, Edward Heske, Douglas Kelt, Joan M. Meiners, Jim #> Munger, Carla Restrepo, Douglas A. Samson, Michele R. Schutzenhofer, #> Marian Skupski, Sarah R. Supp, Kate Thibault, Shawn Taylor, Ethan #> White, Diane W. Davidson, James H. Brown, and Thomas J. Valone. #> (2018). The Portal Project: a long-term study of a Chihuahuan desert #> ecosystem. bioRxiv, https://doi.org/10.1101/332783 #> #> A BibTeX entry for LaTeX users is #> #> @Article{ernest2018portal, #> title = {The Portal Project: a long-term study of a Chihuahuan desert ecosystem}, #> author = {S. K. Morgan Ernest and Glenda M. Yenni and Ginger Allington and Ellen K. Bledsoe and Erica M. Christensen and Renata M. Diaz and Keith Geluso and Jacob R. Goheen and Qinfeng Guo and Edward Heske and Douglas Kelt and Joan M. Meiners and Jim Munger and Carla Restrepo and Douglas A. Samson and Michele R. Schutzenhofer and Marian Skupski and Sarah R. Supp and Kate Thibault and Shawn Taylor and Ethan White and Diane W. Davidson and James H. Brown and Thomas J. Valone}, #> year = {2018}, #> journal = {bioRxiv}, #> doi = {10.1101/332783}, #> }"},{"path":"https://weecology.github.io/portalr/reference/add_seasons.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Seasons — add_seasons","title":"Add Seasons — add_seasons","text":"Higher-order data summaries, 6-month seasons, 3-month seasons, year. Also applies specified functions specified summary level. yearly generates table yearly means","code":""},{"path":"https://weecology.github.io/portalr/reference/add_seasons.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Seasons — add_seasons","text":"","code":"add_seasons( data, level = \"site\", season_level = 2, date_column = \"yearmon\", summary_funs = NA, path = get_default_data_path(), download_if_missing = TRUE, clean = TRUE ) yearly(...)"},{"path":"https://weecology.github.io/portalr/reference/add_seasons.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Seasons — add_seasons","text":"data data frame containing columns: date, period, newmoonnumber, year month level summarize \"Plot\", \"Treatment\", \"Site\" season_level either year, 2: winter = Oct-March summer = April-Sept 4: winter = Dec-Feb spring = March-May summer = Jun-Aug fall = Sep-Nov date_column either \"date\" (must format \"y-m-d\"), \"period\", \"newmoonnumber\", \"yearmon\" (data must contain \"year\" \"month\") summary_funs function specified name (e.g. \"mean\"). Default NA (returned seasons added summarized). path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository download_if_missing specified file path PortalData folder, download clean logical, load QA/QC rodent data (TRUE) data (FALSE) ... arguments passed add_seasons","code":""},{"path":"https://weecology.github.io/portalr/reference/add_seasons.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Seasons — add_seasons","text":"data.frame additional \"season\" \"year\" column, columns summarized specified. summary function specified, \"season\" \"year\" columns added original dataframe, well \"seasonyear\" column correctly assigns months seasons grouping (eg December 2000 winter 2001, rather winter 2000).","code":""},{"path":"https://weecology.github.io/portalr/reference/bait_presence_absence.html","id":null,"dir":"Reference","previous_headings":"","what":"Ant Bait Presence Absence — bait_presence_absence","title":"Ant Bait Presence Absence — bait_presence_absence","text":"Get ant species presence/absence year/plot/stake bait census data Bait census data consistent time colony census data. function assumes species present least one census censused years.","code":""},{"path":"https://weecology.github.io/portalr/reference/bait_presence_absence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Ant Bait Presence Absence — bait_presence_absence","text":"","code":"bait_presence_absence( path = get_default_data_path(), level = \"Site\", download_if_missing = TRUE, quiet = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/bait_presence_absence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Ant Bait Presence Absence — bait_presence_absence","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository level level summarize data: 'Site', 'Plot', 'Stake' download_if_missing specified file path PortalData folder, download quiet logical, whether run without version messages","code":""},{"path":"https://weecology.github.io/portalr/reference/bait_presence_absence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Ant Bait Presence Absence — bait_presence_absence","text":"data frame year, species, (plot applicable), presence [1, 0]","code":""},{"path":"https://weecology.github.io/portalr/reference/check_for_newer_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check for latest version of data files — check_for_newer_data","title":"Check for latest version of data files — check_for_newer_data","text":"Check latest version data exists GitHub repo","code":""},{"path":"https://weecology.github.io/portalr/reference/check_for_newer_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check for latest version of data files — check_for_newer_data","text":"","code":"check_for_newer_data(path = get_default_data_path())"},{"path":"https://weecology.github.io/portalr/reference/check_for_newer_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check for latest version of data files — check_for_newer_data","text":"path Folder data checked","code":""},{"path":"https://weecology.github.io/portalr/reference/check_for_newer_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check for latest version of data files — check_for_newer_data","text":"bool TRUE newer version data online","code":""},{"path":"https://weecology.github.io/portalr/reference/clean_plant_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Do basic cleaning of Portal plant data — clean_plant_data","title":"Do basic cleaning of Portal plant data — clean_plant_data","text":"function basic quality control Portal plant data. mainly called summarize_plant_data, several arguments passed along. specific steps , order: (1) correct species names according recent vouchers, requested (2) restrict species annuals non-woody (3) remove records unidentified species (5) exclude plots long-term treatments","code":""},{"path":"https://weecology.github.io/portalr/reference/clean_plant_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Do basic cleaning of Portal plant data — clean_plant_data","text":"","code":"clean_plant_data( data_tables, type = \"All\", unknowns = FALSE, correct_sp = TRUE )"},{"path":"https://weecology.github.io/portalr/reference/clean_plant_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Do basic cleaning of Portal plant data — clean_plant_data","text":"data_tables list data_tables, returned calling load_plant_data type specify subset species; type=Annuals, removes non-annual species. type=Non-woody, removes shrub subshrub species type=Perennials, returns perennial species (includes shrubs subshrubs) type=Shrubs, returns shrubs subshrubs type=Winter-annual, returns annuals found winter type=Summer-annual, returns annuals found summer unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE) correct_sp T/F whether use likely corrected plant IDs, passed rename_species_plants","code":""},{"path":"https://weecology.github.io/portalr/reference/clean_rodent_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Do basic cleaning of Portal rodent data — clean_rodent_data","title":"Do basic cleaning of Portal rodent data — clean_rodent_data","text":"function basic quality control Portal rodent data. mainly called summarize_rodent_data, several arguments passed along. specific steps , order: (1) add missing weight data (2) remove records \"bad\" period codes plot numbers (3) remove records unidentified species (4) exclude non-granivores (5) exclude incomplete trapping sessions (6) exclude plots long-term treatments","code":""},{"path":"https://weecology.github.io/portalr/reference/clean_rodent_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Do basic cleaning of Portal rodent data — clean_rodent_data","text":"","code":"clean_rodent_data( rodent_data, species_table, fillweight = FALSE, type = \"Rodents\", unknowns = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/clean_rodent_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Do basic cleaning of Portal rodent data — clean_rodent_data","text":"rodent_data raw rodent data table species_table species table fillweight specify whether fill unknown weights records individual species, possible type specify subset species; either \"Rodents\" \"Granivores\" unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE)","code":""},{"path":"https://weecology.github.io/portalr/reference/colony_presence_absence.html","id":null,"dir":"Reference","previous_headings":"","what":"Ant Colony Presence Absence — colony_presence_absence","title":"Ant Colony Presence Absence — colony_presence_absence","text":"Get ant species presence/absence year/plot/stake colony census data Anomalies ant colony census protocol years means can difficult discern true absences species years. function uses information Portal_ant_species.csv Portal_ant_dataflags.csv predict true presence/absence species per plot per year. conservative estimate desired, setting argument 'rare_sp = T' include species confident censused regularly. Setting 'rare_sp = F' may include false absences, since unknown rare species censused years. Unknowns may also excluded output desired.","code":""},{"path":"https://weecology.github.io/portalr/reference/colony_presence_absence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Ant Colony Presence Absence — colony_presence_absence","text":"","code":"colony_presence_absence( path = get_default_data_path(), level = \"Site\", rare_sp = FALSE, unknowns = FALSE, download_if_missing = TRUE, quiet = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/colony_presence_absence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Ant Colony Presence Absence — colony_presence_absence","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository level level summarize data: 'Site', 'Plot', 'Stake' rare_sp include rare species (T) (F). Rare species may may censused years. Setting `rare_sp = FALSE` gives conservative estimate presence/absence unknowns include unknown species (TRUE) (FALSE). Unknowns include identified genus. download_if_missing specified file path PortalData folder, download quiet logical, whether run without version messages","code":""},{"path":"https://weecology.github.io/portalr/reference/colony_presence_absence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Ant Colony Presence Absence — colony_presence_absence","text":"data frame year, species, (plot applicable), presence [1, 0, NA]","code":""},{"path":"https://weecology.github.io/portalr/reference/download_observations.html","id":null,"dir":"Reference","previous_headings":"","what":"Download the PortalData repo — download_observations","title":"Download the PortalData repo — download_observations","text":"Downloads specified version Portal data.","code":""},{"path":"https://weecology.github.io/portalr/reference/download_observations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download the PortalData repo — download_observations","text":"","code":"download_observations( path = get_default_data_path(), version = \"latest\", source = \"github\", quiet = FALSE, verbose = FALSE, pause = 30, timeout = getOption(\"timeout\"), force = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/download_observations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download the PortalData repo — download_observations","text":"path character Folder data downloaded. version character Version data download (default = \"latest\"). NULL, returns. source character indicator source download. Either \"github\" (default) \"zenodo\". quiet logical whether download data silently. verbose logical whether provide details downloading. pause Positive integer integer numeric seconds pausing steps around unzipping require time delayment. timeout Positive integer integer numeric seconds timeout downloads. Temporarily overrides \"timeout\" option options. force logical indicator whether existing files folders (archive) -written --date copy exists (users leave FALSE).","code":""},{"path":"https://weecology.github.io/portalr/reference/download_observations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download the PortalData repo — download_observations","text":"NULL invisibly.","code":""},{"path":"https://weecology.github.io/portalr/reference/fcast_ndvi.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","title":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","text":"Forecast ndvi using seasonal auto ARIMA","code":""},{"path":"https://weecology.github.io/portalr/reference/fcast_ndvi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","text":"","code":"fcast_ndvi(hist_ndvi, level, lead, moons = NULL)"},{"path":"https://weecology.github.io/portalr/reference/fcast_ndvi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","text":"hist_ndvi historic ndvi data level specify \"monthly\" \"newmoon\" lead number steps forward forecast moons moon data (required level = \"newmoon\")","code":""},{"path":"https://weecology.github.io/portalr/reference/fcast_ndvi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","text":"data.frame time ndvi values","code":""},{"path":"https://weecology.github.io/portalr/reference/fcast_ndvi.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","text":"ndvi values forecast using auto.arima seasonality (using Fourier transform)","code":""},{"path":"https://weecology.github.io/portalr/reference/fill_missing_ndvi.html","id":null,"dir":"Reference","previous_headings":"","what":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","title":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","text":"Fill historic ndvi data complete timeseries fit","code":""},{"path":"https://weecology.github.io/portalr/reference/fill_missing_ndvi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","text":"","code":"fill_missing_ndvi(ndvi, level, last_time, moons = NULL)"},{"path":"https://weecology.github.io/portalr/reference/fill_missing_ndvi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","text":"ndvi ndvi data level specify \"monthly\" \"newmoon\" last_time last time step completed moons moon data (required level = \"newmoons\" forecasts needed)","code":""},{"path":"https://weecology.github.io/portalr/reference/fill_missing_ndvi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","text":"data.frame time ndvi values","code":""},{"path":"https://weecology.github.io/portalr/reference/fill_missing_ndvi.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","text":"missing values time series replaced using na.interp, missing values end time series forecast using auto.arima seasonality (using Fourier transform)","code":""},{"path":"https://weecology.github.io/portalr/reference/find_incomplete_censuses.html","id":null,"dir":"Reference","previous_headings":"","what":"Period code for incomplete censuses — find_incomplete_censuses","title":"Period code for incomplete censuses — find_incomplete_censuses","text":"Determines incomplete censuses finding dates plots trapped, others .","code":""},{"path":"https://weecology.github.io/portalr/reference/find_incomplete_censuses.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Period code for incomplete censuses — find_incomplete_censuses","text":"","code":"find_incomplete_censuses(trapping_table, min_plots, min_traps)"},{"path":"https://weecology.github.io/portalr/reference/find_incomplete_censuses.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Period code for incomplete censuses — find_incomplete_censuses","text":"trapping_table Data_table plots censused. min_plots minimum number plots within period observation included min_traps minimum number traps plot included","code":""},{"path":"https://weecology.github.io/portalr/reference/find_incomplete_censuses.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Period code for incomplete censuses — find_incomplete_censuses","text":"Data.table period codes plots trapped.","code":""},{"path":"https://weecology.github.io/portalr/reference/format_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Format content as code — format_code","title":"Format content as code — format_code","text":"Format content code","code":""},{"path":"https://weecology.github.io/portalr/reference/format_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format content as code — format_code","text":"","code":"format_code(...)"},{"path":"https://weecology.github.io/portalr/reference/format_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format content as code — format_code","text":"... strings","code":""},{"path":"https://weecology.github.io/portalr/reference/format_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format content as code — format_code","text":"formatted string output","code":""},{"path":"https://weecology.github.io/portalr/reference/format_todo.html","id":null,"dir":"Reference","previous_headings":"","what":"Format content as an action to be performed by the user — format_todo","title":"Format content as an action to be performed by the user — format_todo","text":"Format content action performed user","code":""},{"path":"https://weecology.github.io/portalr/reference/format_todo.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format content as an action to be performed by the user — format_todo","text":"","code":"format_todo(...)"},{"path":"https://weecology.github.io/portalr/reference/format_todo.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format content as an action to be performed by the user — format_todo","text":"... strings","code":""},{"path":"https://weecology.github.io/portalr/reference/format_todo.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format content as an action to be performed by the user — format_todo","text":"formatted string output","code":""},{"path":"https://weecology.github.io/portalr/reference/format_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Format content as a variable value — format_value","title":"Format content as a variable value — format_value","text":"Format content variable value","code":""},{"path":"https://weecology.github.io/portalr/reference/format_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format content as a variable value — format_value","text":"","code":"format_value(...)"},{"path":"https://weecology.github.io/portalr/reference/format_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format content as a variable value — format_value","text":"... strings","code":""},{"path":"https://weecology.github.io/portalr/reference/format_value.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format content as a variable value — format_value","text":"formatted string output","code":""},{"path":"https://weecology.github.io/portalr/reference/get_dataset_citation.html","id":null,"dir":"Reference","previous_headings":"","what":"Return Citation for Portal Data — get_dataset_citation","title":"Return Citation for Portal Data — get_dataset_citation","text":"Return Citation Portal Data","code":""},{"path":"https://weecology.github.io/portalr/reference/get_dataset_citation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return Citation for Portal Data — get_dataset_citation","text":"","code":"get_dataset_citation()"},{"path":"https://weecology.github.io/portalr/reference/get_dataset_citation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return Citation for Portal Data — get_dataset_citation","text":"object class \"citation\". details, see `citation()`","code":""},{"path":"https://weecology.github.io/portalr/reference/get_future_newmoons.html","id":null,"dir":"Reference","previous_headings":"","what":"Get future newmoon dates and numbers — get_future_newmoons","title":"Get future newmoon dates and numbers — get_future_newmoons","text":"Get next newmoon dates assign newmoon numbers forecasting","code":""},{"path":"https://weecology.github.io/portalr/reference/get_future_newmoons.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get future newmoon dates and numbers — get_future_newmoons","text":"","code":"get_future_newmoons(newmoons, nfuture_newmoons = NULL)"},{"path":"https://weecology.github.io/portalr/reference/get_future_newmoons.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get future newmoon dates and numbers — get_future_newmoons","text":"newmoons current newmoon table nfuture_newmoons number future newmoons get","code":""},{"path":"https://weecology.github.io/portalr/reference/get_future_newmoons.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get future newmoon dates and numbers — get_future_newmoons","text":"expected newmoons table requested future newmoons","code":""},{"path":"https://weecology.github.io/portalr/reference/load_datafile.html","id":null,"dir":"Reference","previous_headings":"","what":"read in a raw datafile from the downloaded data or the GitHub repo — load_datafile","title":"read in a raw datafile from the downloaded data or the GitHub repo — load_datafile","text":"checking whether particular datafile exists reads , using na_strings determine gets converted NA. can also download dataset missing locally.","code":""},{"path":"https://weecology.github.io/portalr/reference/load_datafile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"read in a raw datafile from the downloaded data or the GitHub repo — load_datafile","text":"","code":"load_datafile( datafile, na.strings = \"\", path = get_default_data_path(), download_if_missing = TRUE, quiet = TRUE, ... )"},{"path":"https://weecology.github.io/portalr/reference/load_datafile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"read in a raw datafile from the downloaded data or the GitHub repo — load_datafile","text":"datafile path datafile within folder Portal data na.strings character vector strings interpreted NA values. Blank fields also considered missing values logical, integer, numeric complex fields. Note test happens white space stripped input, na.strings values may need white space stripped advance. path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository download_if_missing specified file path PortalData folder, download quiet logical, whether perform operations silently ... arguments passed download_observations","code":""},{"path":"https://weecology.github.io/portalr/reference/load_rodent_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Read in the Portal data files — load_rodent_data","title":"Read in the Portal data files — load_rodent_data","text":"Loads Portal data files either user-defined path online Github repository. user-defined path un- available, default option download location. load_rodent_data loads rodent data files load_plant_data loads plant data files load_ant_data loads ant data files load_trapping_data loads just rodent trapping files","code":""},{"path":"https://weecology.github.io/portalr/reference/load_rodent_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read in the Portal data files — load_rodent_data","text":"","code":"load_rodent_data( path = get_default_data_path(), download_if_missing = TRUE, clean = TRUE, quiet = FALSE, ... ) load_plant_data( path = get_default_data_path(), download_if_missing = TRUE, quiet = FALSE, ... ) load_ant_data( path = get_default_data_path(), download_if_missing = TRUE, quiet = FALSE, ... ) load_trapping_data( path = get_default_data_path(), download_if_missing = TRUE, clean = TRUE, quiet = FALSE, ... )"},{"path":"https://weecology.github.io/portalr/reference/load_rodent_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read in the Portal data files — load_rodent_data","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository download_if_missing specified file path PortalData folder, download clean logical, load QA/QC rodent data (TRUE) data (FALSE) quiet logical, whether run without version messages ... arguments passed download_observations","code":""},{"path":"https://weecology.github.io/portalr/reference/load_rodent_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read in the Portal data files — load_rodent_data","text":"load_rodent_data returns list 5 dataframes: load_plant_data returns list 7 dataframes: load_ant_data returns list 4 dataframes: load_trapping_data returns list 2 dataframes:","code":""},{"path":"https://weecology.github.io/portalr/reference/na_conformer.html","id":null,"dir":"Reference","previous_headings":"","what":"Conform NA entries to ","title":"Conform NA entries to ","text":"Given species abbreviation Neotoma albigula (NA), data read , can NA \"NA\". function conforms entries proper character values.","code":""},{"path":"https://weecology.github.io/portalr/reference/na_conformer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conform NA entries to ","text":"","code":"na_conformer(dfv, colname = \"species\")"},{"path":"https://weecology.github.io/portalr/reference/na_conformer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conform NA entries to ","text":"dfv Either [1] data.frame containing colname column NAs need conformed \"NA\"s [2] vector NAs need conformed \"NA\"s. colname character value column name tab conform NAs \"NA\"s.","code":""},{"path":"https://weecology.github.io/portalr/reference/na_conformer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Conform NA entries to ","text":"x NA colname replaced \"NA\".","code":""},{"path":"https://weecology.github.io/portalr/reference/na_conformer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Conform NA entries to ","text":"","code":"na_conformer(c(\"a\", \"b\", NA, \"c\")) #> [1] \"a\" \"b\" \"NA\" \"c\""},{"path":"https://weecology.github.io/portalr/reference/ndvi.html","id":null,"dir":"Reference","previous_headings":"","what":"NDVI by calendar month or lunar month — ndvi","title":"NDVI by calendar month or lunar month — ndvi","text":"Summarize NDVI data monthly lunar monthly level","code":""},{"path":"https://weecology.github.io/portalr/reference/ndvi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"NDVI by calendar month or lunar month — ndvi","text":"","code":"ndvi( level = \"monthly\", sensor = \"landsat\", fill = FALSE, path = get_default_data_path(), download_if_missing = TRUE )"},{"path":"https://weecology.github.io/portalr/reference/ndvi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"NDVI by calendar month or lunar month — ndvi","text":"level specify \"monthly\" \"newmoon\" sensor specify \"landsat\", \"modis\", \"gimms\", \"\" fill specify missing data filled, passed fill_missing_ndvi path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository download_if_missing specified file path PortalData folder, download ","code":""},{"path":"https://weecology.github.io/portalr/reference/phenocam.html","id":null,"dir":"Reference","previous_headings":"","what":"Phenocam data products by day, calendar month, or lunar month — phenocam","title":"Phenocam data products by day, calendar month, or lunar month — phenocam","text":"Summarize phenocam data products either daily, monthly, lunar monthly level.","code":""},{"path":"https://weecology.github.io/portalr/reference/phenocam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Phenocam data products by day, calendar month, or lunar month — phenocam","text":"","code":"phenocam(level = \"daily\", path = get_default_data_path())"},{"path":"https://weecology.github.io/portalr/reference/phenocam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Phenocam data products by day, calendar month, or lunar month — phenocam","text":"level specify 'monthly', 'daily', 'newmoon' path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository","code":""},{"path":"https://weecology.github.io/portalr/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://weecology.github.io/portalr/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://weecology.github.io/portalr/reference/portalr.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates summaries of the Portal data — portalr","title":"Creates summaries of the Portal data — portalr","text":"package designed interface Portal data, resides online https://github.com/weecology/portalData. contains set functions download, clean, summarize data.","code":""},{"path":[]},{"path":"https://weecology.github.io/portalr/reference/portalr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Creates summaries of the Portal data — portalr","text":"Maintainer: Glenda M. Yenni glenda@weecology.org (ORCID) Authors: Hao Ye (ORCID) Erica M. Christensen (ORCID) Juniper L. Simonis (ORCID) Ellen K. Bledsoe (ORCID) Renata M. Diaz (ORCID) Shawn D. Taylor (ORCID) Ethan P, White (ORCID) S.K. Morgan Ernest (ORCID) contributors: Weecology [copyright holder]","code":""},{"path":"https://weecology.github.io/portalr/reference/print.html","id":null,"dir":"Reference","previous_headings":"","what":"Prints a portal_data_list object — print.portal_data_list","title":"Prints a portal_data_list object — print.portal_data_list","text":"Prints portal_data_list object","code":""},{"path":"https://weecology.github.io/portalr/reference/print.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prints a portal_data_list object — print.portal_data_list","text":"","code":"# S3 method for class 'portal_data_list' print(x, ...)"},{"path":"https://weecology.github.io/portalr/reference/print.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prints a portal_data_list object — print.portal_data_list","text":"x portal_data_list object. ... arguments passed print","code":""},{"path":"https://weecology.github.io/portalr/reference/return_if_null.html","id":null,"dir":"Reference","previous_headings":"","what":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","title":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","text":"focal input NULL, return value parent function. used within function.","code":""},{"path":"https://weecology.github.io/portalr/reference/return_if_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","text":"","code":"return_if_null(x, value = NULL)"},{"path":"https://weecology.github.io/portalr/reference/return_if_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","text":"x Focal input. value x NULL, return input parent function.","code":""},{"path":"https://weecology.github.io/portalr/reference/return_if_null.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","text":"x NULL, NULL returned. x NULL, result return value input evaluated within parent function's environment returned.","code":""},{"path":"https://weecology.github.io/portalr/reference/return_if_null.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","text":"","code":"ff <- function(x = 1, null_return = \"hello\"){ return_if_null(x, null_return) x } ff() #> [1] 1 ff(NULL) #> [1] \"hello\""},{"path":"https://weecology.github.io/portalr/reference/rodent_species.html","id":null,"dir":"Reference","previous_headings":"","what":"Rodent species abbreviations — rodent_species","title":"Rodent species abbreviations — rodent_species","text":"Creates simple character vector abbreviations Portal Rodents.","code":""},{"path":"https://weecology.github.io/portalr/reference/rodent_species.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rodent species abbreviations — rodent_species","text":"","code":"rodent_species( path = get_default_data_path(), type = \"code\", set = \"all\", total = FALSE ) forecasting_species( path = get_default_data_path(), total = FALSE, type = \"abbreviation\" )"},{"path":"https://weecology.github.io/portalr/reference/rodent_species.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rodent species abbreviations — rodent_species","text":"path character Folder data downloaded. type character value indicating output type. Current options include 'abbreviation' 'code' (default, two-letter abbreviation), 'g_species' (abbreviated genus species), 'Latin' (full scientific names), 'common' (common names), 'table' (data.frame options). set character input specified set species. Options include \"\" (default, species included) \"forecasting\" (species used forecating pipelines). total logical value indicating \"total\" added .","code":""},{"path":"https://weecology.github.io/portalr/reference/rodent_species.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Rodent species abbreviations — rodent_species","text":"character vector species abbreviations.","code":""},{"path":"https://weecology.github.io/portalr/reference/shrub_cover.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate percent cover from Portal plant transect data — shrub_cover","title":"Generate percent cover from Portal plant transect data — shrub_cover","text":"function calculates percent cover transect data. handles pre-2015 data differently current transects, becase collected differently. returns single time-series years transect data available. also returns mean height beginning 2015.","code":""},{"path":"https://weecology.github.io/portalr/reference/shrub_cover.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate percent cover from Portal plant transect data — shrub_cover","text":"","code":"shrub_cover( path = get_default_data_path(), type = \"Shrubs\", plots = \"all\", unknowns = FALSE, correct_sp = TRUE, download_if_missing = TRUE, quiet = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/shrub_cover.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate percent cover from Portal plant transect data — shrub_cover","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository type specify subset species; type=Annuals, removes non-annual species. type=Summer Annuals, returns annual species can found summer type=Winter Annuals, returns annual species can found winter type=Non-woody, removes shrub subshrub species type=Perennials, returns perennial species (includes shrubs subshrubs) type=Shrubs, returns shrubs subshrubs plots specify subset plots; can vector plots, specific sets: \"\" plots \"Longterm\" plots (plots treatment entire time series) unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE) correct_sp correct species names suspected incorrect early data (T/F) download_if_missing specified file path PortalData folder, download quiet logical, whether run without version messages","code":""},{"path":"https://weecology.github.io/portalr/reference/shrub_cover.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate percent cover from Portal plant transect data — shrub_cover","text":"data.frame percent cover mean height","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_individual_rodents.html","id":null,"dir":"Reference","previous_headings":"","what":"Return cleaned Portal rodent individual data — summarize_individual_rodents","title":"Return cleaned Portal rodent individual data — summarize_individual_rodents","text":"function cleans subsets data based number arguments. returns stake number individual level data.","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_individual_rodents.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return cleaned Portal rodent individual data — summarize_individual_rodents","text":"","code":"summarize_individual_rodents( path = get_default_data_path(), clean = TRUE, type = \"Rodents\", length = \"all\", unknowns = FALSE, time = \"period\", fillweight = FALSE, min_plots = 1, min_traps = 1, download_if_missing = TRUE, quiet = FALSE ) summarise_individual_rodents( path = get_default_data_path(), clean = TRUE, type = \"Rodents\", length = \"all\", unknowns = FALSE, time = \"period\", fillweight = FALSE, min_plots = 1, min_traps = 1, download_if_missing = TRUE, quiet = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/summarize_individual_rodents.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return cleaned Portal rodent individual data — summarize_individual_rodents","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository clean logical, load QA/QC rodent data (TRUE) data (FALSE) type specify subset species; either \"Rodents\" \"Granivores\" length specify subset plots; use \"\" plots \"Longterm\" plots (deprecated) unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE) time specify format time index output, either \"period\" (sequential Portal surveys), \"newmoon\" (lunar cycle numbering), \"date\" (calendar date), \"\" (time indices) fillweight specify whether fill unknown weights records individual species, possible min_plots minimum number plots within period observation included min_traps minimum number traps plot included download_if_missing specified file path PortalData folder, download quiet logical, whether run without producing messages","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_individual_rodents.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return cleaned Portal rodent individual data — summarize_individual_rodents","text":"data.frame","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_plant_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate summaries of Portal plant data — summarize_plant_data","title":"Generate summaries of Portal plant data — summarize_plant_data","text":"function generic interface creating summaries Portal plant species data. contains number arguments specify kind data summarize, level aggregation, various choices dealing data quality, output format. plant_abundance generates table plant abundance","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_plant_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate summaries of Portal plant data — summarize_plant_data","text":"","code":"summarize_plant_data( path = get_default_data_path(), level = \"Site\", type = \"All\", length = \"all\", plots = length, unknowns = FALSE, correct_sp = TRUE, shape = \"flat\", output = \"abundance\", na_drop = switch(tolower(level), quadrat = FALSE, plot = FALSE, treatment = TRUE, site = TRUE, TRUE), zero_drop = switch(tolower(level), quadrat = TRUE, plot = FALSE, treatment = TRUE, site = TRUE, TRUE), min_quads = 1, effort = TRUE, download_if_missing = TRUE, quiet = FALSE ) plant_abundance(..., shape = \"flat\") summarise_plant_data( path = get_default_data_path(), level = \"Site\", type = \"All\", length = \"all\", plots = length, unknowns = FALSE, correct_sp = TRUE, shape = \"flat\", output = \"abundance\", na_drop = switch(tolower(level), quadrat = FALSE, plot = FALSE, treatment = TRUE, site = TRUE, TRUE), zero_drop = switch(tolower(level), quadrat = TRUE, plot = FALSE, treatment = TRUE, site = TRUE, TRUE), min_quads = 1, effort = TRUE, download_if_missing = TRUE, quiet = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/summarize_plant_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate summaries of Portal plant data — summarize_plant_data","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository level summarize \"Plot\", \"Treatment\", \"Site\", \"Quadrat\" type specify subset species; type=Annuals, removes non-annual species. type=Summer Annuals, returns annual species can found summer type=Winter Annuals, returns annual species can found winter type=Non-woody, removes shrub subshrub species type=Perennials, returns perennial species (includes shrubs subshrubs) type=Shrubs, returns shrubs subshrubs length specify subset plots; use \"\" plots \"Longterm\" plots (deprecated) plots specify subset plots; can vector plots, specific sets: \"\" plots \"Longterm\" plots (plots treatment entire time series) unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE) correct_sp correct species names suspected incorrect early data (T/F) shape return data \"crosstab\" \"flat\" list output specify whether return \"abundance\", \"cover\" [cover data starts summer 2015] na_drop logical, drop NA values (representing insufficient sampling) filling missing combinations year-month-treatment/plot-species NA represent one slightly different meanings: 1) combo exist 2) combo skipped month, 3) combo trapped, unusable (negative period code)) zero_drop logical, drop 0s (representing sufficient sampling, detection) min_quads numeric [1:16], minimum number quadrats (16) plot included effort logical whether effort columns included output download_if_missing specified file path PortalData folder, download quiet logical, whether run without version messages ... arguments passed summarize_plant_data","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_plant_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate summaries of Portal plant data — summarize_plant_data","text":"data.frame either \"long\" \"wide\" format, depending value `shape`","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_rodent_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate summaries of Portal rodent data — summarize_rodent_data","title":"Generate summaries of Portal rodent data — summarize_rodent_data","text":"function generic interface creating summaries Portal rodent species data. contains number arguments specify kind data summarize (level aggregation) various choices dealing data quality, output format. abundance generates table rodent abundance * biomass() generates table rodent biomass * energy() generates table rodent energy (computed 5.69 * (biomass ^ 0.75) White et al 2004) * rates() generates table rodent growth rates (computed r=log(N[t+1]/N[t])","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_rodent_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate summaries of Portal rodent data — summarize_rodent_data","text":"","code":"summarize_rodent_data( path = get_default_data_path(), clean = TRUE, level = \"Site\", type = \"Rodents\", length = \"all\", plots = length, unknowns = FALSE, shape = \"crosstab\", time = \"period\", output = \"abundance\", fillweight = (output != \"abundance\"), na_drop = TRUE, zero_drop = switch(tolower(level), plot = FALSE, treatment = TRUE, site = TRUE), min_traps = 1, min_plots = 24, effort = FALSE, download_if_missing = TRUE, quiet = FALSE, include_unsampled = FALSE ) abundance(...) biomass(...) energy(...) rates(...) summarise_rodent_data( path = get_default_data_path(), clean = TRUE, level = \"Site\", type = \"Rodents\", length = \"all\", plots = length, unknowns = FALSE, shape = \"crosstab\", time = \"period\", output = \"abundance\", fillweight = (output != \"abundance\"), na_drop = TRUE, zero_drop = switch(tolower(level), plot = FALSE, treatment = TRUE, site = TRUE), min_traps = 1, min_plots = 24, effort = FALSE, download_if_missing = TRUE, quiet = FALSE, include_unsampled = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/summarize_rodent_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate summaries of Portal rodent data — summarize_rodent_data","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository clean logical, load QA/QC rodent data (TRUE) data (FALSE) level summarize \"Plot\", \"Treatment\", \"Site\" type specify subset species; either \"Rodents\" \"Granivores\" length specify subset plots; use \"\" plots \"Longterm\" plots (deprecated) plots specify subset plots; can vector plots, specific sets: \"\" plots \"Longterm\" plots (plots treatment entire time series) unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE) shape return data \"crosstab\" \"flat\" list time specify format time index output, either \"period\" (sequential Portal surveys), \"newmoon\" (lunar cycle numbering), \"date\" (calendar date), \"\" (time indices) output specify whether return \"abundance\", \"biomass\", \"energy\", \"rates\" fillweight specify whether fill unknown weights records individual species, possible na_drop logical, drop NA values (representing insufficient sampling) filling missing combinations year-month-treatment/plot-species NA represent one slightly different meanings: 1) combo exist 2) combo skipped month, 3) combo trapped, unusable (negative period code)) zero_drop logical, drop 0s (representing sufficient sampling, detection) min_traps minimum number traps plot included min_plots minimum number plots within period observation included effort logical whether effort columns included output download_if_missing specified file path PortalData folder, download quiet logical, whether run without producing messages include_unsampled logical, overrides settings `na_drop` `zero_drop`, setting FALSE ... arguments passed summarize_rodent_data","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_rodent_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate summaries of Portal rodent data — summarize_rodent_data","text":"data.frame either \"long\" \"wide\" format, depending value `shape`","code":""},{"path":"https://weecology.github.io/portalr/reference/use_default_data_path.html","id":null,"dir":"Reference","previous_headings":"","what":"Manage the default path for downloading Portal Data into — check_default_data_path","title":"Manage the default path for downloading Portal Data into — check_default_data_path","text":"check_default_data_path checks default data path set, prompts user set missing. get_default_data_path gets value data path environmental variable use_default_data_path 3 steps. First, checks presence pre-existing setting environmental variable. checks folder exists creates , needed. provides instructions setting environmental variable.","code":""},{"path":"https://weecology.github.io/portalr/reference/use_default_data_path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manage the default path for downloading Portal Data into — check_default_data_path","text":"","code":"check_default_data_path( ENV_VAR = \"PORTALR_DATA_PATH\", MESSAGE_FUN = message, DATA_NAME = \"Portal data\" ) get_default_data_path(fallback = \"~\", ENV_VAR = \"PORTALR_DATA_PATH\") use_default_data_path(path = NULL, ENV_VAR = \"PORTALR_DATA_PATH\")"},{"path":"https://weecology.github.io/portalr/reference/use_default_data_path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manage the default path for downloading Portal Data into — check_default_data_path","text":"ENV_VAR environmental variable check (default `\"PORTALR_DATA_PATH\"“) MESSAGE_FUN function use output messages DATA_NAME name dataset use output messages fallback default value use setting missing path character Folder data downloaded.","code":""},{"path":"https://weecology.github.io/portalr/reference/use_default_data_path.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Manage the default path for downloading Portal Data into — check_default_data_path","text":"FALSE path set, TRUE otherwise None","code":""},{"path":"https://weecology.github.io/portalr/reference/weather.html","id":null,"dir":"Reference","previous_headings":"","what":"Weather by day, calendar month, or lunar month — weather","title":"Weather by day, calendar month, or lunar month — weather","text":"Summarize hourly weather data either daily, monthly, lunar monthly level.","code":""},{"path":"https://weecology.github.io/portalr/reference/weather.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Weather by day, calendar month, or lunar month — weather","text":"","code":"weather( level = \"daily\", fill = FALSE, horizon = 365, temperature_limit = 4, path = get_default_data_path() )"},{"path":"https://weecology.github.io/portalr/reference/weather.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Weather by day, calendar month, or lunar month — weather","text":"level specify 'monthly', 'daily', 'newmoon' fill specify missing data filled, passed fill_missing_weather horizon Horizon (number days) use calculating cumulative values (eg warm weather precip) temperature_limit Temperature limit (C) use calculating cumulative values (eg warm weather precip) path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository","code":""},{"path":"https://weecology.github.io/portalr/news/index.html","id":"portalr-042","dir":"Changelog","previous_headings":"","what":"portalr 0.4.2","title":"portalr 0.4.2","text":"CRAN release: 2024-08-28 2024-08-08 portalr now uses testthat 3rd edition portalr longer imports clisymbols crayon. messages generated cli. format_todo(), format_code(), format_value() can replaced inline markup (.e. {.val}, {.code}, etc.) may removed package.","code":""},{"path":"https://weecology.github.io/portalr/news/index.html","id":"portalr-041","dir":"Changelog","previous_headings":"","what":"portalr 0.4.1","title":"portalr 0.4.1","text":"CRAN release: 2023-08-23 2023-08-23","code":""},{"path":[]},{"path":"https://weecology.github.io/portalr/news/index.html","id":"portalr-040","dir":"Changelog","previous_headings":"","what":"portalr 0.4.0","title":"portalr 0.4.0","text":"CRAN release: 2023-04-21 2023-04-21","code":""},{"path":[]},{"path":"https://weecology.github.io/portalr/news/index.html","id":"download_observations-argument-update-0-4-0","dir":"Changelog","previous_headings":"","what":"download_observations argument update","title":"portalr 0.4.0","text":"from_zenodo replaced source","code":""},{"path":"https://weecology.github.io/portalr/news/index.html","id":"get_future_moons-replaced-with-get_future_newmoons-0-4-0","dir":"Changelog","previous_headings":"","what":"get_future_moons replaced with get_future_newmoons","title":"portalr 0.4.0","text":"arguments updated moons num_future_moons newmoons nfuture_newmoons now defaulty number moons add NULL call return_if_null ","code":""},{"path":"https://weecology.github.io/portalr/news/index.html","id":"addition-of-new-functions-pulled-from-portalcasting-0-4-0","dir":"Changelog","previous_headings":"","what":"addition of new functions (pulled from portalcasting)","title":"portalr 0.4.0","text":"return_if_null() rodent_species(): helper function now operates rodent table, hard-coded na_conformer(): makes sure species abbreviation Neotoma albigula character value","code":""}] +[{"path":[]},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Code of Conduct","text":"interest fostering open welcoming environment, contributors maintainers pledge making participation project community harassment-free experience everyone, regardless age, body size, disability, ethnicity, gender identity expression, level experience, nationality, personal appearance, race, religion, sexual identity orientation.","code":""},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Code of Conduct","text":"Examples behavior contributes creating positive environment include: Using welcoming inclusive language respectful differing viewpoints experiences Gracefully accepting constructive criticism Focusing best community Showing empathy towards community members Examples unacceptable behavior participants include: use sexualized language imagery unwelcome sexual attention advances Trolling, insulting/derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical electronic address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"our-responsibilities","dir":"","previous_headings":"","what":"Our Responsibilities","title":"Contributor Code of Conduct","text":"Project maintainers responsible clarifying standards acceptable behavior expected take appropriate fair corrective action response instances unacceptable behavior. Project maintainers right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, ban temporarily permanently contributor behaviors deem inappropriate, threatening, offensive, harmful.","code":""},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Code of Conduct","text":"Code Conduct applies within project spaces public spaces individual representing project community. Examples representing project community include using official project e-mail address, posting via official social media account, acting appointed representative online offline event. Representation project may defined clarified project maintainers.","code":""},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported contacting project team ethan@weecology.org. complaints reviewed investigated result response deemed necessary appropriate circumstances. project team obligated maintain confidentiality regard reporter incident. details specific enforcement policies may posted separately. Project maintainers follow enforce Code Conduct good faith may face temporary permanent repercussions determined members project’s leadership.","code":""},{"path":"https://weecology.github.io/portalr/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 1.4, available https://www.contributor-covenant.org/version/1/4/code--conduct.html","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"guidelines-for-contributing","dir":"","previous_headings":"","what":"Guidelines for Contributing","title":"NA","text":"Thanks checking project! haven’t already, please check readme general info project.","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"contributor-code-of-conduct","dir":"","previous_headings":"","what":"Contributor Code of Conduct","title":"NA","text":"contributors expected follow code conduct.","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"for-the-general-public","dir":"","previous_headings":"","what":"For the General Public","title":"NA","text":"’re member Weecology lab, ask use one following two methods contributing: Create issue – spot typos, bugs, general suggestions, etc. can also use participate ongoing discussions. info, please check Github guide. Fork create pull request – suggested bugfixes changes. info, please check Github guide. ask follow guidelines documentation testing.","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"weecologists","dir":"","previous_headings":"For the General Public","what":"Weecologists","title":"NA","text":"’re actively working repo, write access create branches new features bugfixes. Please see lab-wiki info using branches shared repository. don’t write access like , please contact @gmyenni access.","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"documentation","dir":"","previous_headings":"For the General Public","what":"Documentation","title":"NA","text":"contributing code project, generally don’t need additional packages, since documentation written comments R scripts. also building package, see section details. cases, ’ll creating new function documenting . can check existing functions examples, ’s basic template: Note can also include links functions, math formatting, . details, see chapter documentation Hadley Wickham’s book R packages.","code":"#' @title {this is the heading for the help file} #' #' @description {A description of the function} #' #' @param {name of a function argument} {what the argument does} #' @return {what is returned from the function} #' @examples #' {R code that is an example use of the function} #' @export #' newfunc <- function() ..."},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"testing","dir":"","previous_headings":"For the General Public","what":"Testing","title":"NA","text":"adding new functionality, please include automated tests verify basic functionality correct. Automated testing uses R scripts, live tests/testthat/ subfolder package. adding new file, please name test-{concept}.R. general rule, don’t need test possible inputs outputs function, test important aspects: * outputs correct format (including dimensions components) * sample input produces correct sample output can see existing tests examples organize tests, note several different kinds expect_ functions test different things. details, see chapter testing Hadley Wickham’s book R packages.","code":""},{"path":"https://weecology.github.io/portalr/CONTRIBUTING.html","id":"building","dir":"","previous_headings":"For the General Public","what":"Building","title":"NA","text":"fully build package, including documentation, running-tests, need roxygen2, testthat, devtools package. Specific operations done calling appropriate functions within R, working directory somewhere package folder. suggested workflow : 1. Write code, documentation, tests. 2. Run devtools::document() generate documentation files update NAMESPACE file. 3. Run devtools::install() install new version package. 4. Run devtools::test() run test scripts new version package. also prepping package whole, also want run devtools::check() /devtools::check_cran() make sure package complete. info, see GitHub repo devtools package.","code":""},{"path":"https://weecology.github.io/portalr/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2018 Weecology Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Examples of How Portal Researchers Are Using the Package","text":"portalr package started series scripts used Portal researchers quickly consistently summarize Portal data. developed formalized package, dealing quirky data manipulation hood. Now, researchers currently collecting data Portal started actively using package work. examples using package included .","code":""},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"installing-the-package","dir":"Articles","previous_headings":"Introduction","what":"Installing the Package","title":"Examples of How Portal Researchers Are Using the Package","text":"First, need install portalr package haven’t done already. ’ll also load tidyverse, many packages data manipulation plotting.","code":"#devtools::install_github(\"weecology/portalr\") library(portalr) library(dplyr) library(tidyr) library(ggplot2)"},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"rodent-biomass-ratios-between-plot-treatment-types","dir":"Articles","previous_headings":"","what":"Rodent Biomass Ratios between Plot Treatment Types","title":"Examples of How Portal Researchers Are Using the Package","text":"One thing can Portal rodent data look ratio biomass control plots kangaroo rat exclosure plots changed time.","code":""},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"getting-the-data-we-want","dir":"Articles","previous_headings":"Rodent Biomass Ratios between Plot Treatment Types","what":"Getting the Data We Want","title":"Examples of How Portal Researchers Are Using the Package","text":"going compare biomass plot types, need know biomass plot. achieve , can set level = \"plot\" Note path argument summarize_rodent_data function set “repo.” can choose download Portal data onto local computer load data R, can also get data directly GitHub repository setting path = \"repo\" ’ve done . data structure look like , columns date, treatment, plot number, species:","code":"biomass_data <- portalr::summarize_rodent_data(path = \"repo\", level = \"plot\", output = \"biomass\", time = \"date\")"},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"working-with-the-data","dir":"Articles","previous_headings":"Rodent Biomass Ratios between Plot Treatment Types","what":"Working with the Data","title":"Examples of How Portal Researchers Are Using the Package","text":"Let’s select rows want: Based information plot treatment switches can found Readme file PortalData repo, want select censuses years 1988-2014; make data bit easier work , can also split date column three separate columns filter year column. Since comparing control plots exclosure plots, can also filter treatment types. can get total biomass plot per census summing mass species per row. , sum year treatment type. , can create exclosure:control ratio.","code":"biomass_data <- biomass_data %>% # split the date column into year, month, and day separate(col = censusdate, into = c(\"year\", \"month\", \"day\"), sep = \"-\") %>% filter(year >= 1988 & year < 2015, # filter by year treatment == \"control\" | treatment == \"exclosure\") # filter by treatment type # compute total biomass per year and treatment biomass_total <- biomass_data %>% gather(species, biomass, BA:SO) %>% group_by(year, treatment) %>% summarize(totals = sum(biomass, na.rm = TRUE)) # make a column with the exclosure:control ratio biomass_ratio <- biomass_total %>% spread(treatment, totals) %>% mutate(EX_to_CO_ratio = exclosure / control) %>% ungroup()"},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"plotting-the-ratios","dir":"Articles","previous_headings":"Rodent Biomass Ratios between Plot Treatment Types","what":"Plotting the Ratios","title":"Examples of How Portal Researchers Are Using the Package","text":"can finally plot data! mid-1990s, biomass kangaroo rat exclosures never went 50% biomass found control plots; small granivores just couldn’t keep larger kangaroo rats. larger pocket mouse, Chaetodipus baileyi, showed system (first gray bar), found primarily kangaroo rat exclosures. increased biomass ratio 80% found control plots. C. baileyi left system (second gray bar), ratio returned similar levels arrival.","code":""},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"working-with-plant-data","dir":"Articles","previous_headings":"","what":"Working with Plant Data","title":"Examples of How Portal Researchers Are Using the Package","text":"rodent community data frequently utilized data Portal Project, can also use portalr get plant ant data site. ’ve running multivariate statistics plant composition plots looking differences rodent treatment types. get data need .","code":""},{"path":"https://weecology.github.io/portalr/articles/portal_researcher_examples.html","id":"getting-the-data-we-want-1","dir":"Articles","previous_headings":"Working with Plant Data","what":"Getting the Data We Want","title":"Examples of How Portal Researchers Are Using the Package","text":"site two rainy periods , therefore, two communities annual plants. Let’s say want take look abundance winter annuals system, want see differ treatment type. can use summarize_plant_data function get appropriate data. arguments mean? , path = 'repo' pulls data directly online repository. level = 'plot' indicates want data summarized plot level rather across entire site, type = 'winter-annual' give us annual species can found winter months. Sometimes past, misidentified species plant; correct_sp = TRUE goes data corrects species name now know correct species. times, just don’t know species , unknown; don’t want included, use unknown = FALSE. Finally, want abundance species returned. Unlike rodent abundance, however, ’ve asked flat shape, data structure long format look like : Wait second! Didn’t ask winter annuals? first rows summer plant census? turns , two annual communities plants, annuals system can found summer winter. Hypothetically, someone might want know annual plants found winter: many show summer, example? get data want–just winter annuals found winter season–just need one quick line code. ’s like ! Now data want run multivariate statistics whatever else might want data.","code":"plant_data <- portalr::summarize_plant_data(path = 'repo', level = 'plot', type = 'winter-annual', correct_sp = TRUE, unknowns = FALSE, shape = 'flat', output = 'abundance') plant_data_winter <- dplyr::filter(plant_data, season == 'winter')"},{"path":[]},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Portal Rodent Abundance Demo","text":"vignette basic guide begin exploring Portal data. load data (making sure ’re using recent copy GitHub), explore rodent abundances time, comparison “control” “kangaroo rat exclosure” treatments.","code":""},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"package-setup","dir":"Articles","previous_headings":"Introduction","what":"Package Setup","title":"Portal Rodent Abundance Demo","text":"First load several packages: tidyverse contains several packages data manipulation plotting. cowplot contains nicer default theme ggplot. portalr package, contains functions read Portal data basic processing.","code":"library(dplyr) library(tidyr) library(ggplot2) library(cowplot) library(portalr)"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"retrieving-the-data","dir":"Articles","previous_headings":"","what":"Retrieving the Data","title":"Portal Rodent Abundance Demo","text":"Note package contain actual Portal data, resides online GitHub repository. First, try load data. isn’t Portal folder, load_rodent_data fall back downloading data, well. check whether already data. don’t data, version isn’t recent, use download_observations function download latest copy data. load_rodent_data function reads several tables related rodent abundances. won’t necessarily use tables, loading now gives us access later.","code":"portal_data_path <- tempdir() # use a temporary folder to store downloaded data data_tables <- load_rodent_data(portal_data_path, download_if_missing = TRUE) #> Warning in load_datafile(file.path(\"Rodents\", \"Portal_rodent.csv\"), na.strings = \"\", : Proceeding to download data into specified path/tmp/Rtmp3p4Eap #> Downloading version `5.102.0` of the data... #> Loading in data version 5.102.0 print(summary(data_tables)) #> Length Class Mode #> rodent_data 31 data.frame list #> species_table 15 data.frame list #> trapping_table 8 data.frame list #> newmoons_table 4 data.frame list #> plots_table 6 data.frame list"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"rodent-abundances","dir":"Articles","previous_headings":"","what":"Rodent Abundances","title":"Portal Rodent Abundance Demo","text":"first table loaded (data_tables$rodent_data) record whatever found traps, mostly rodents, also taxa. just wanted get rodent abundance data, use abundance function, default arguments filter non-rodents. Let’s convert data long format easier facetting. Also, want scientific names instead two-letter species codes, let’s matching, :","code":"# get rodent abundance by plot rodent_abundance_by_plot <- abundance(path = portal_data_path, time = \"date\", level = \"plot\") #> Loading in data version 5.102.0 rodent_abundance <- rodent_abundance_by_plot %>% gather(species, abundance, -censusdate, -treatment, -plot) %>% count(species, censusdate, wt = abundance) %>% rename(abundance = n) print(summary(rodent_abundance)) #> species censusdate abundance #> Length:9513 Min. :1979-09-22 Min. : 0.000 #> Class :character 1st Qu.:1989-12-04 1st Qu.: 0.000 #> Mode :character Median :1999-06-12 Median : 0.000 #> Mean :2000-05-21 Mean : 6.897 #> 3rd Qu.:2010-09-05 3rd Qu.: 5.000 #> Max. :2023-06-20 Max. :334.000 join_scientific_name <- function(rodent_abundance, species_table = data_tables$species_table) { return(rodent_abundance %>% left_join(select(species_table, \"species\", \"scientificname\"), by = \"species\") %>% rename(scientific_name = scientificname) ) } rodent_abundance <- join_scientific_name(rodent_abundance)"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"figure-abundance-over-time","dir":"Articles","previous_headings":"Rodent Abundances","what":"Figure: abundance over time","title":"Portal Rodent Abundance Demo","text":"Monthly abundance rodents (plots)","code":"make_abundance_plot_over_time <- function(rodent_abundance) { return(ggplot(rodent_abundance, aes(x = censusdate, y = abundance)) + geom_line() + facet_wrap(~scientific_name, scales = \"free_y\", ncol = 3) + xlab(\"Date\") + ylab(\"Abundance\") + scale_x_date(breaks = seq(as.Date(\"1977-01-01\"), to = as.Date(\"2018-01-01\"), \"+5 years\"), date_labels = \"%Y\", limits = as.Date(c(\"1977-01-01\", \"2018-01-01\"))) + theme_cowplot() + theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5), legend.position = \"bottom\", legend.justification = \"center\", strip.text.x = element_text(size = 10)) ) } my_plot <- make_abundance_plot_over_time(rodent_abundance) print(my_plot) #> Warning: Removed 41 rows containing missing values or values outside the scale range #> (`geom_line()`)."},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"next-steps","dir":"Articles","previous_headings":"Rodent Abundances","what":"Next Steps","title":"Portal Rodent Abundance Demo","text":"next steps likely dig deeper rodent abundances different treatments, first want know different treatments look like, let’s revisit abundances later.","code":""},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"plot-treatments","dir":"Articles","previous_headings":"","what":"Plot Treatments","title":"Portal Rodent Abundance Demo","text":"description experimental design treatments can found Readme file PortalDate repo. now, just going use Portal_plots table file look treatments individual plots changed time. Note file already loaded plots_table loadData function ran previously. want proper date variable well converting plot factor:","code":"print(summary(data_tables$plots_table)) #> year month plot treatment #> Min. :1977 Min. : 1.000 Min. : 1.00 Length:11576 #> 1st Qu.:1988 1st Qu.: 4.000 1st Qu.: 6.00 Class :character #> Median :1999 Median : 7.000 Median :12.00 Mode :character #> Mean :1999 Mean : 6.536 Mean :12.49 #> 3rd Qu.:2010 3rd Qu.:10.000 3rd Qu.:18.00 #> Max. :2023 Max. :12.000 Max. :24.00 #> resourcetreatment anttreatment #> Length:11576 Length:11576 #> Class :character Class :character #> Mode :character Mode :character #> #> #> plot_treatments <- data_tables$plots_table %>% mutate(iso_date = as.Date(paste0(year, \"-\", month, \"-\", \"01\")), plot = as.factor(plot)) %>% select(iso_date, plot, treatment)"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"figure-plot-treatments-over-time","dir":"Articles","previous_headings":"Plot Treatments","what":"Figure: plot treatments over time","title":"Portal Rodent Abundance Demo","text":"Treatments Plots Date","code":"my_plot <- ggplot(plot_treatments, aes(x = iso_date, y = treatment, color = treatment)) + geom_point(shape = 20) + geom_vline(aes(xintercept = as.Date(\"1977-10-01\")), linetype = 2) + geom_vline(aes(xintercept = as.Date(\"1988-01-01\")), linetype = 2) + geom_vline(aes(xintercept = as.Date(\"2005-01-01\")), linetype = 2) + geom_vline(aes(xintercept = as.Date(\"2015-04-01\")), linetype = 2) + facet_wrap(~plot, ncol = 4) + xlab(\"Date\") + ylab(\"Treatment\") + scale_color_manual(values = rainbow(4)) + scale_x_date(breaks = seq(as.Date(\"1977-01-01\"), to = as.Date(\"2018-01-01\"), \"+5 years\"), date_labels = \"%Y\") + theme_cowplot() + guides(color = \"none\") + theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)) print(my_plot)"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"identifying-control-plots","dir":"Articles","previous_headings":"Plot Treatments","what":"Identifying control plots","title":"Portal Rodent Abundance Demo","text":"treatments plots changed time: cases, due initial ramping experimental protocol, others, exclusions Dipodomys spectabilis started converted back later species went locally extinct (e.g. plots 1, 5, 9, 24).","code":""},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"which-plots-have-always-been-control-plots","dir":"Articles","previous_headings":"Plot Treatments > Identifying control plots","what":"Which plots have always been control plots?","title":"Portal Rodent Abundance Demo","text":"Note, however, excludes several plots treatment changed ~2015. can include plots first filtering date testing “control” treatment: identify datespan plots controls:","code":"always_control_plots <- plot_treatments %>% group_by(plot) %>% summarize(always_control = all(treatment == \"control\")) %>% filter(always_control) print(always_control_plots) #> # A tibble: 4 × 2 #> plot always_control #> #> 1 4 TRUE #> 2 11 TRUE #> 3 14 TRUE #> 4 17 TRUE mostly_control_plots <- plot_treatments %>% filter(iso_date < \"2015-01-01\") %>% group_by(plot) %>% summarize(mostly_control = all(treatment == \"control\")) %>% filter(mostly_control) print(mostly_control_plots) #> # A tibble: 8 × 2 #> plot mostly_control #> #> 1 2 TRUE #> 2 4 TRUE #> 3 8 TRUE #> 4 11 TRUE #> 5 12 TRUE #> 6 14 TRUE #> 7 17 TRUE #> 8 22 TRUE date_span <- plot_treatments %>% filter(plot %in% mostly_control_plots$plot) %>% group_by(iso_date) %>% summarize(all_control = all(treatment == \"control\")) %>% filter(all_control) print(date_span) #> # A tibble: 411 × 2 #> iso_date all_control #> #> 1 1977-07-01 TRUE #> 2 1977-08-01 TRUE #> 3 1977-09-01 TRUE #> 4 1977-10-01 TRUE #> 5 1977-11-01 TRUE #> 6 1977-12-01 TRUE #> 7 1978-01-01 TRUE #> 8 1978-02-01 TRUE #> 9 1978-03-01 TRUE #> 10 1978-04-01 TRUE #> # ℹ 401 more rows"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"abundances-over-control-plots","dir":"Articles","previous_headings":"Plot Treatments","what":"Abundances over control plots","title":"Portal Rodent Abundance Demo","text":"now ready plot abundances just control plots time span 1977-07-01 2015-03-01. retrieving abundance data plot, filtering accordingly: Monthly abundance rodents (control plots)","code":"rodent_abundance_by_plot %>% filter(censusdate >= min(date_span$iso_date), censusdate <= max(date_span$iso_date), plot %in% mostly_control_plots$plot) %>% select(-treatment, -plot) %>% gather(species, abundance, -censusdate) %>% count(censusdate, species, wt = abundance) %>% rename(abundance = n) %>% join_scientific_name() %>% {.} -> rodent_abundance_control rodent_abundance_control %>% make_abundance_plot_over_time() %>% print()"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"abundances-over-rodent-exclosures","dir":"Articles","previous_headings":"Plot Treatments","what":"Abundances over rodent exclosures","title":"Portal Rodent Abundance Demo","text":"can “exclosure” condition. First, plots: , datespan: Finally, figure: Monthly abundance rodents (exclosure plots) Since data number plots previous figure, can directly compare abundances. Note decreased numbers kangaroo rats (Dipodomys spp.) increased numbers taxa.","code":"mostly_exclosure_plots <- plot_treatments %>% filter(iso_date > as.Date(\"1989-01-01\"), iso_date < \"2015-01-01\") %>% group_by(plot) %>% summarize(mostly_exclosure = all(treatment == \"exclosure\")) %>% filter(mostly_exclosure) print(mostly_exclosure_plots) #> # A tibble: 8 × 2 #> plot mostly_exclosure #> #> 1 3 TRUE #> 2 6 TRUE #> 3 13 TRUE #> 4 15 TRUE #> 5 18 TRUE #> 6 19 TRUE #> 7 20 TRUE #> 8 21 TRUE date_span <- plot_treatments %>% filter(plot %in% mostly_exclosure_plots$plot) %>% group_by(iso_date) %>% summarize(all_exclosure = all(treatment == \"exclosure\")) %>% filter(all_exclosure) print(date_span) #> # A tibble: 297 × 2 #> iso_date all_exclosure #> #> 1 1988-01-01 TRUE #> 2 1988-02-01 TRUE #> 3 1988-03-01 TRUE #> 4 1988-04-01 TRUE #> 5 1988-05-01 TRUE #> 6 1988-06-01 TRUE #> 7 1988-07-01 TRUE #> 8 1988-08-01 TRUE #> 9 1988-09-01 TRUE #> 10 1988-10-01 TRUE #> # ℹ 287 more rows rodent_abundance_by_plot %>% filter(censusdate >= min(date_span$iso_date), censusdate <= max(date_span$iso_date), plot %in% mostly_exclosure_plots$plot) %>% select(-treatment, -plot) %>% gather(species, abundance, -censusdate) %>% count(censusdate, species, wt = abundance) %>% rename(abundance = n) %>% join_scientific_name() %>% {.} -> rodent_abundance_exclosure rodent_abundance_exclosure %>% make_abundance_plot_over_time() %>% print()"},{"path":"https://weecology.github.io/portalr/articles/rodent-abundance-demo.html","id":"comparison-figure","dir":"Articles","previous_headings":"Plot Treatments","what":"Comparison Figure","title":"Portal Rodent Abundance Demo","text":"Let’s merge two datasets produce combined plot: Monthly abundance rodents (control vs. exclosure plots) expected, substantially lower counts kangaroo rats (Dipodomys spp.) “exclosure” plots. also observe similar abundances species, increases others (e.g. “Chaetodipus baileyi”, “Perognathus flavus”, “Reithrodontomys megalotis”)","code":"rodent_abundance_merged <- bind_rows( mutate(rodent_abundance_control, treatment = \"control\"), mutate(rodent_abundance_exclosure, treatment = \"exclosure\")) merged_plot <- ggplot(rodent_abundance_merged, aes(x = censusdate, y = abundance, color = treatment)) + geom_line() + facet_wrap(~scientific_name, scales = \"free_y\", ncol = 3) + xlab(\"Date\") + ylab(\"Abundance\") + scale_x_date(breaks = seq(as.Date(\"1977-01-01\"), to = as.Date(\"2018-01-01\"), \"+5 years\"), date_labels = \"%Y\", limits = as.Date(c(\"1977-01-01\", \"2018-01-01\"))) + scale_color_manual(values = c(\"purple\", \"yellow\")) + theme_cowplot() + theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5), legend.position = \"bottom\", legend.justification = \"center\", strip.text.x = element_text(size = 10)) print(merged_plot)"},{"path":"https://weecology.github.io/portalr/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Glenda M. Yenni. Author, maintainer. Hao Ye. Author. Erica M. Christensen. Author. Juniper L. Simonis. Author. Ellen K. Bledsoe. Author. Renata M. Diaz. Author. Shawn D. Taylor. Author. Ethan P, White. Author. S.K. Morgan Ernest. Author. Weecology. Copyright holder.","code":""},{"path":"https://weecology.github.io/portalr/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Erica M. Christensen, Glenda M. Yenni, Hao Ye, Juniper L. Simonis, Ellen K. Bledsoe, Renata M. Diaz, Shawn D. Taylor, Ethan P. White, S. K. Morgan Ernest. (2019). portalr: R package summarizing using Portal Project Data. Journal Open Source Software, 4(33), 1098, https://doi.org/10.21105/joss.01098","code":"@Article{christensen2019portalr, title = {portalr: an R package for summarizing and using the Portal Project Data}, author = {Erica M. Christensen and Glenda M. Yenni and Hao Ye and Juniper L. Simonis and Ellen K. Bledsoe and Renata M. Diaz and Shawn D. Taylor and Ethan P. White and S. K. Morgan Ernest}, year = {2019}, journal = {Journal of Open Source Software}, volume = {4}, number = {33}, pages = {1098}, doi = {10.21105/joss.01098}, }"},{"path":[]},{"path":"https://weecology.github.io/portalr/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Create Useful Summaries of the Portal Data","text":"portalr package provides collection basic functions summarize Portal project data rodents, plants, ants, weather long-term field site Chihuahuan Desert. data begin 1977 continuously updated today. functions summarize rodent abundance, biomass, energy site, plot, treatment type. functions summarize weather data collected automated weather stations plant data collected summer fall.","code":""},{"path":"https://weecology.github.io/portalr/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Create Useful Summaries of the Portal Data","text":"can install portalr CRAN : github :","code":"install.packages(\"portalr\") # install.packages(\"remotes\") remotes::install_github(\"weecology/portalr\")"},{"path":"https://weecology.github.io/portalr/index.html","id":"examples","dir":"","previous_headings":"","what":"Examples","title":"Create Useful Summaries of the Portal Data","text":"Load data tables PortalData GitHub repo: Download generate summaries rodent abundance biomass: Retrieve weather data: detailed info, checkout vignettes associated package:","code":"data_tables <- load_rodent_data(\"repo\") download_observations(\".\") rodent_data <- abundance(\".\") # default grouping is by sampling period rodent_biomass_by_plot <- biomass(\".\", level = \"plot\", type = \"granivores\", shape = \"flat\", time = \"date\") weatherdata <- weather(\"Monthly\", \".\") browseVignettes(\"portalr\")"},{"path":[]},{"path":"https://weecology.github.io/portalr/index.html","id":"portal-data-repo","dir":"","previous_headings":"More Information","what":"Portal Data Repo","title":"Create Useful Summaries of the Portal Data","text":"data repo contains useful details issues data collection, background handle way . course, also contains raw data, like create complex data summaries provided .","code":""},{"path":"https://weecology.github.io/portalr/index.html","id":"the-portal-project","dir":"","previous_headings":"More Information","what":"The Portal Project","title":"Create Useful Summaries of the Portal Data","text":"Find list previous publications using Portal data website.","code":""},{"path":"https://weecology.github.io/portalr/index.html","id":"the-portal-blog","dir":"","previous_headings":"More Information","what":"The Portal Blog","title":"Create Useful Summaries of the Portal Data","text":"Follow blog get latest news happening project site.","code":""},{"path":"https://weecology.github.io/portalr/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Create Useful Summaries of the Portal Data","text":"cite portalr, please refer either: JOSS publication: Erica M. Christensen, Glenda M. Yenni, Hao Ye, Juniper L. Simonis, Ellen K. Bledsoe, Renata M. Diaz, Shawn D. Taylor, Ethan P. White, S. K. Morgan Ernest. (2019). portalr: R package summarizing using Portal Project Data. Journal Open Source Software, 4(33), 1098, https://doi.org/10.21105/joss.01098 use recent release Zenodo.","code":""},{"path":"https://weecology.github.io/portalr/index.html","id":"dataset-citation","dir":"","previous_headings":"Citation","what":"Dataset Citation","title":"Create Useful Summaries of the Portal Data","text":"cite Portal dataset, use:","code":"get_dataset_citation() #> #> To cite the Portal Data in publications, use: #> #> S. K. Morgan Ernest, Glenda M. Yenni, Ginger Allington, Ellen K. #> Bledsoe, Erica M. Christensen, Renata M. Diaz, Keith Geluso, Jacob R. #> Goheen, Qinfeng Guo, Edward Heske, Douglas Kelt, Joan M. Meiners, Jim #> Munger, Carla Restrepo, Douglas A. Samson, Michele R. Schutzenhofer, #> Marian Skupski, Sarah R. Supp, Kate Thibault, Shawn Taylor, Ethan #> White, Diane W. Davidson, James H. Brown, and Thomas J. Valone. #> (2018). The Portal Project: a long-term study of a Chihuahuan desert #> ecosystem. bioRxiv, https://doi.org/10.1101/332783 #> #> A BibTeX entry for LaTeX users is #> #> @Article{ernest2018portal, #> title = {The Portal Project: a long-term study of a Chihuahuan desert ecosystem}, #> author = {S. K. Morgan Ernest and Glenda M. Yenni and Ginger Allington and Ellen K. Bledsoe and Erica M. Christensen and Renata M. Diaz and Keith Geluso and Jacob R. Goheen and Qinfeng Guo and Edward Heske and Douglas Kelt and Joan M. Meiners and Jim Munger and Carla Restrepo and Douglas A. Samson and Michele R. Schutzenhofer and Marian Skupski and Sarah R. Supp and Kate Thibault and Shawn Taylor and Ethan White and Diane W. Davidson and James H. Brown and Thomas J. Valone}, #> year = {2018}, #> journal = {bioRxiv}, #> doi = {10.1101/332783}, #> }"},{"path":"https://weecology.github.io/portalr/reference/add_seasons.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Seasons — add_seasons","title":"Add Seasons — add_seasons","text":"Higher-order data summaries, 6-month seasons, 3-month seasons, year. Also applies specified functions specified summary level. yearly generates table yearly means","code":""},{"path":"https://weecology.github.io/portalr/reference/add_seasons.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Seasons — add_seasons","text":"","code":"add_seasons( data, level = \"site\", season_level = 2, date_column = \"yearmon\", summary_funs = NA, path = get_default_data_path(), download_if_missing = TRUE, clean = TRUE ) yearly(...)"},{"path":"https://weecology.github.io/portalr/reference/add_seasons.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Seasons — add_seasons","text":"data data frame containing columns: date, period, newmoonnumber, year month level summarize \"Plot\", \"Treatment\", \"Site\" season_level either year, 2: winter = Oct-March summer = April-Sept 4: winter = Dec-Feb spring = March-May summer = Jun-Aug fall = Sep-Nov date_column either \"date\" (must format \"y-m-d\"), \"period\", \"newmoonnumber\", \"yearmon\" (data must contain \"year\" \"month\") summary_funs function specified name (e.g. \"mean\"). Default NA (returned seasons added summarized). path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository download_if_missing specified file path PortalData folder, download clean logical, load QA/QC rodent data (TRUE) data (FALSE) ... arguments passed add_seasons","code":""},{"path":"https://weecology.github.io/portalr/reference/add_seasons.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Seasons — add_seasons","text":"data.frame additional \"season\" \"year\" column, columns summarized specified. summary function specified, \"season\" \"year\" columns added original dataframe, well \"seasonyear\" column correctly assigns months seasons grouping (eg December 2000 winter 2001, rather winter 2000).","code":""},{"path":"https://weecology.github.io/portalr/reference/bait_presence_absence.html","id":null,"dir":"Reference","previous_headings":"","what":"Ant Bait Presence Absence — bait_presence_absence","title":"Ant Bait Presence Absence — bait_presence_absence","text":"Get ant species presence/absence year/plot/stake bait census data Bait census data consistent time colony census data. function assumes species present least one census censused years.","code":""},{"path":"https://weecology.github.io/portalr/reference/bait_presence_absence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Ant Bait Presence Absence — bait_presence_absence","text":"","code":"bait_presence_absence( path = get_default_data_path(), level = \"Site\", download_if_missing = TRUE, quiet = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/bait_presence_absence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Ant Bait Presence Absence — bait_presence_absence","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository level level summarize data: 'Site', 'Plot', 'Stake' download_if_missing specified file path PortalData folder, download quiet logical, whether run without version messages","code":""},{"path":"https://weecology.github.io/portalr/reference/bait_presence_absence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Ant Bait Presence Absence — bait_presence_absence","text":"data frame year, species, (plot applicable), presence [1, 0]","code":""},{"path":"https://weecology.github.io/portalr/reference/check_for_newer_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check for latest version of data files — check_for_newer_data","title":"Check for latest version of data files — check_for_newer_data","text":"Check latest version data exists GitHub repo","code":""},{"path":"https://weecology.github.io/portalr/reference/check_for_newer_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check for latest version of data files — check_for_newer_data","text":"","code":"check_for_newer_data(path = get_default_data_path())"},{"path":"https://weecology.github.io/portalr/reference/check_for_newer_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check for latest version of data files — check_for_newer_data","text":"path Folder data checked","code":""},{"path":"https://weecology.github.io/portalr/reference/check_for_newer_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check for latest version of data files — check_for_newer_data","text":"bool TRUE newer version data online","code":""},{"path":"https://weecology.github.io/portalr/reference/clean_plant_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Do basic cleaning of Portal plant data — clean_plant_data","title":"Do basic cleaning of Portal plant data — clean_plant_data","text":"function basic quality control Portal plant data. mainly called summarize_plant_data, several arguments passed along. specific steps , order: (1) correct species names according recent vouchers, requested (2) restrict species annuals non-woody (3) remove records unidentified species (5) exclude plots long-term treatments","code":""},{"path":"https://weecology.github.io/portalr/reference/clean_plant_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Do basic cleaning of Portal plant data — clean_plant_data","text":"","code":"clean_plant_data( data_tables, type = \"All\", unknowns = FALSE, correct_sp = TRUE )"},{"path":"https://weecology.github.io/portalr/reference/clean_plant_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Do basic cleaning of Portal plant data — clean_plant_data","text":"data_tables list data_tables, returned calling load_plant_data type specify subset species; type=Annuals, removes non-annual species. type=Non-woody, removes shrub subshrub species type=Perennials, returns perennial species (includes shrubs subshrubs) type=Shrubs, returns shrubs subshrubs type=Winter-annual, returns annuals found winter type=Summer-annual, returns annuals found summer unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE) correct_sp T/F whether use likely corrected plant IDs, passed rename_species_plants","code":""},{"path":"https://weecology.github.io/portalr/reference/clean_rodent_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Do basic cleaning of Portal rodent data — clean_rodent_data","title":"Do basic cleaning of Portal rodent data — clean_rodent_data","text":"function basic quality control Portal rodent data. mainly called summarize_rodent_data, several arguments passed along. specific steps , order: (1) add missing weight data (2) remove records \"bad\" period codes plot numbers (3) remove records unidentified species (4) exclude non-granivores (5) exclude incomplete trapping sessions (6) exclude plots long-term treatments","code":""},{"path":"https://weecology.github.io/portalr/reference/clean_rodent_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Do basic cleaning of Portal rodent data — clean_rodent_data","text":"","code":"clean_rodent_data( rodent_data, species_table, fillweight = FALSE, type = \"Rodents\", unknowns = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/clean_rodent_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Do basic cleaning of Portal rodent data — clean_rodent_data","text":"rodent_data raw rodent data table species_table species table fillweight specify whether fill unknown weights records individual species, possible type specify subset species; either \"Rodents\" \"Granivores\" unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE)","code":""},{"path":"https://weecology.github.io/portalr/reference/colony_presence_absence.html","id":null,"dir":"Reference","previous_headings":"","what":"Ant Colony Presence Absence — colony_presence_absence","title":"Ant Colony Presence Absence — colony_presence_absence","text":"Get ant species presence/absence year/plot/stake colony census data Anomalies ant colony census protocol years means can difficult discern true absences species years. function uses information Portal_ant_species.csv Portal_ant_dataflags.csv predict true presence/absence species per plot per year. conservative estimate desired, setting argument 'rare_sp = T' include species confident censused regularly. Setting 'rare_sp = F' may include false absences, since unknown rare species censused years. Unknowns may also excluded output desired.","code":""},{"path":"https://weecology.github.io/portalr/reference/colony_presence_absence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Ant Colony Presence Absence — colony_presence_absence","text":"","code":"colony_presence_absence( path = get_default_data_path(), level = \"Site\", rare_sp = FALSE, unknowns = FALSE, download_if_missing = TRUE, quiet = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/colony_presence_absence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Ant Colony Presence Absence — colony_presence_absence","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository level level summarize data: 'Site', 'Plot', 'Stake' rare_sp include rare species (T) (F). Rare species may may censused years. Setting `rare_sp = FALSE` gives conservative estimate presence/absence unknowns include unknown species (TRUE) (FALSE). Unknowns include identified genus. download_if_missing specified file path PortalData folder, download quiet logical, whether run without version messages","code":""},{"path":"https://weecology.github.io/portalr/reference/colony_presence_absence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Ant Colony Presence Absence — colony_presence_absence","text":"data frame year, species, (plot applicable), presence [1, 0, NA]","code":""},{"path":"https://weecology.github.io/portalr/reference/download_observations.html","id":null,"dir":"Reference","previous_headings":"","what":"Download the PortalData repo — download_observations","title":"Download the PortalData repo — download_observations","text":"Downloads specified version Portal data.","code":""},{"path":"https://weecology.github.io/portalr/reference/download_observations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download the PortalData repo — download_observations","text":"","code":"download_observations( path = get_default_data_path(), version = \"latest\", source = \"github\", quiet = FALSE, verbose = FALSE, pause = 30, timeout = getOption(\"timeout\"), force = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/download_observations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download the PortalData repo — download_observations","text":"path character Folder data downloaded. version character Version data download (default = \"latest\"). NULL, returns. source character indicator source download. Either \"github\" (default) \"zenodo\". quiet logical whether download data silently. verbose logical whether provide details downloading. pause Positive integer integer numeric seconds pausing steps around unzipping require time delayment. timeout Positive integer integer numeric seconds timeout downloads. Temporarily overrides \"timeout\" option options. force logical indicator whether existing files folders (archive) -written --date copy exists (users leave FALSE).","code":""},{"path":"https://weecology.github.io/portalr/reference/download_observations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download the PortalData repo — download_observations","text":"NULL invisibly.","code":""},{"path":"https://weecology.github.io/portalr/reference/fcast_ndvi.html","id":null,"dir":"Reference","previous_headings":"","what":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","title":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","text":"Forecast ndvi using seasonal auto ARIMA","code":""},{"path":"https://weecology.github.io/portalr/reference/fcast_ndvi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","text":"","code":"fcast_ndvi(hist_ndvi, level, lead, moons = NULL)"},{"path":"https://weecology.github.io/portalr/reference/fcast_ndvi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","text":"hist_ndvi historic ndvi data level specify \"monthly\" \"newmoon\" lead number steps forward forecast moons moon data (required level = \"newmoon\")","code":""},{"path":"https://weecology.github.io/portalr/reference/fcast_ndvi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","text":"data.frame time ndvi values","code":""},{"path":"https://weecology.github.io/portalr/reference/fcast_ndvi.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Forecast ndvi using a seasonal auto ARIMA — fcast_ndvi","text":"ndvi values forecast using auto.arima seasonality (using Fourier transform)","code":""},{"path":"https://weecology.github.io/portalr/reference/fill_missing_ndvi.html","id":null,"dir":"Reference","previous_headings":"","what":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","title":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","text":"Fill historic ndvi data complete timeseries fit","code":""},{"path":"https://weecology.github.io/portalr/reference/fill_missing_ndvi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","text":"","code":"fill_missing_ndvi(ndvi, level, last_time, moons = NULL)"},{"path":"https://weecology.github.io/portalr/reference/fill_missing_ndvi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","text":"ndvi ndvi data level specify \"monthly\" \"newmoon\" last_time last time step completed moons moon data (required level = \"newmoons\" forecasts needed)","code":""},{"path":"https://weecology.github.io/portalr/reference/fill_missing_ndvi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","text":"data.frame time ndvi values","code":""},{"path":"https://weecology.github.io/portalr/reference/fill_missing_ndvi.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fill in historic ndvi data to the complete timeseries being fit — fill_missing_ndvi","text":"missing values time series replaced using na.interp, missing values end time series forecast using auto.arima seasonality (using Fourier transform)","code":""},{"path":"https://weecology.github.io/portalr/reference/find_incomplete_censuses.html","id":null,"dir":"Reference","previous_headings":"","what":"Period code for incomplete censuses — find_incomplete_censuses","title":"Period code for incomplete censuses — find_incomplete_censuses","text":"Determines incomplete censuses finding dates plots trapped, others .","code":""},{"path":"https://weecology.github.io/portalr/reference/find_incomplete_censuses.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Period code for incomplete censuses — find_incomplete_censuses","text":"","code":"find_incomplete_censuses(trapping_table, min_plots, min_traps)"},{"path":"https://weecology.github.io/portalr/reference/find_incomplete_censuses.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Period code for incomplete censuses — find_incomplete_censuses","text":"trapping_table Data_table plots censused. min_plots minimum number plots within period observation included min_traps minimum number traps plot included","code":""},{"path":"https://weecology.github.io/portalr/reference/find_incomplete_censuses.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Period code for incomplete censuses — find_incomplete_censuses","text":"Data.table period codes plots trapped.","code":""},{"path":"https://weecology.github.io/portalr/reference/format_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Format content as code — format_code","title":"Format content as code — format_code","text":"Format content code","code":""},{"path":"https://weecology.github.io/portalr/reference/format_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format content as code — format_code","text":"","code":"format_code(...)"},{"path":"https://weecology.github.io/portalr/reference/format_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format content as code — format_code","text":"... strings","code":""},{"path":"https://weecology.github.io/portalr/reference/format_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format content as code — format_code","text":"formatted string output","code":""},{"path":"https://weecology.github.io/portalr/reference/format_todo.html","id":null,"dir":"Reference","previous_headings":"","what":"Format content as an action to be performed by the user — format_todo","title":"Format content as an action to be performed by the user — format_todo","text":"Format content action performed user","code":""},{"path":"https://weecology.github.io/portalr/reference/format_todo.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format content as an action to be performed by the user — format_todo","text":"","code":"format_todo(...)"},{"path":"https://weecology.github.io/portalr/reference/format_todo.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format content as an action to be performed by the user — format_todo","text":"... strings","code":""},{"path":"https://weecology.github.io/portalr/reference/format_todo.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format content as an action to be performed by the user — format_todo","text":"formatted string output","code":""},{"path":"https://weecology.github.io/portalr/reference/format_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Format content as a variable value — format_value","title":"Format content as a variable value — format_value","text":"Format content variable value","code":""},{"path":"https://weecology.github.io/portalr/reference/format_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format content as a variable value — format_value","text":"","code":"format_value(...)"},{"path":"https://weecology.github.io/portalr/reference/format_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format content as a variable value — format_value","text":"... strings","code":""},{"path":"https://weecology.github.io/portalr/reference/format_value.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format content as a variable value — format_value","text":"formatted string output","code":""},{"path":"https://weecology.github.io/portalr/reference/get_dataset_citation.html","id":null,"dir":"Reference","previous_headings":"","what":"Return Citation for Portal Data — get_dataset_citation","title":"Return Citation for Portal Data — get_dataset_citation","text":"Return Citation Portal Data","code":""},{"path":"https://weecology.github.io/portalr/reference/get_dataset_citation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return Citation for Portal Data — get_dataset_citation","text":"","code":"get_dataset_citation()"},{"path":"https://weecology.github.io/portalr/reference/get_dataset_citation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return Citation for Portal Data — get_dataset_citation","text":"object class \"citation\". details, see `citation()`","code":""},{"path":"https://weecology.github.io/portalr/reference/get_future_newmoons.html","id":null,"dir":"Reference","previous_headings":"","what":"Get future newmoon dates and numbers — get_future_newmoons","title":"Get future newmoon dates and numbers — get_future_newmoons","text":"Get next newmoon dates assign newmoon numbers forecasting","code":""},{"path":"https://weecology.github.io/portalr/reference/get_future_newmoons.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get future newmoon dates and numbers — get_future_newmoons","text":"","code":"get_future_newmoons(newmoons, nfuture_newmoons = NULL)"},{"path":"https://weecology.github.io/portalr/reference/get_future_newmoons.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get future newmoon dates and numbers — get_future_newmoons","text":"newmoons current newmoon table nfuture_newmoons number future newmoons get","code":""},{"path":"https://weecology.github.io/portalr/reference/get_future_newmoons.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get future newmoon dates and numbers — get_future_newmoons","text":"expected newmoons table requested future newmoons","code":""},{"path":"https://weecology.github.io/portalr/reference/load_datafile.html","id":null,"dir":"Reference","previous_headings":"","what":"read in a raw datafile from the downloaded data or the GitHub repo — load_datafile","title":"read in a raw datafile from the downloaded data or the GitHub repo — load_datafile","text":"checking whether particular datafile exists reads , using na_strings determine gets converted NA. can also download dataset missing locally.","code":""},{"path":"https://weecology.github.io/portalr/reference/load_datafile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"read in a raw datafile from the downloaded data or the GitHub repo — load_datafile","text":"","code":"load_datafile( datafile, na.strings = \"\", path = get_default_data_path(), download_if_missing = TRUE, quiet = TRUE, ... )"},{"path":"https://weecology.github.io/portalr/reference/load_datafile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"read in a raw datafile from the downloaded data or the GitHub repo — load_datafile","text":"datafile path datafile within folder Portal data na.strings character vector strings interpreted NA values. Blank fields also considered missing values logical, integer, numeric complex fields. Note test happens white space stripped input, na.strings values may need white space stripped advance. path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository download_if_missing specified file path PortalData folder, download quiet logical, whether perform operations silently ... arguments passed download_observations","code":""},{"path":"https://weecology.github.io/portalr/reference/load_rodent_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Read in the Portal data files — load_rodent_data","title":"Read in the Portal data files — load_rodent_data","text":"Loads Portal data files either user-defined path online Github repository. user-defined path un- available, default option download location. load_rodent_data loads rodent data files load_plant_data loads plant data files load_ant_data loads ant data files load_trapping_data loads just rodent trapping files","code":""},{"path":"https://weecology.github.io/portalr/reference/load_rodent_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read in the Portal data files — load_rodent_data","text":"","code":"load_rodent_data( path = get_default_data_path(), download_if_missing = TRUE, clean = TRUE, quiet = FALSE, ... ) load_plant_data( path = get_default_data_path(), download_if_missing = TRUE, quiet = FALSE, ... ) load_ant_data( path = get_default_data_path(), download_if_missing = TRUE, quiet = FALSE, ... ) load_trapping_data( path = get_default_data_path(), download_if_missing = TRUE, clean = TRUE, quiet = FALSE, ... )"},{"path":"https://weecology.github.io/portalr/reference/load_rodent_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read in the Portal data files — load_rodent_data","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository download_if_missing specified file path PortalData folder, download clean logical, load QA/QC rodent data (TRUE) data (FALSE) quiet logical, whether run without version messages ... arguments passed download_observations","code":""},{"path":"https://weecology.github.io/portalr/reference/load_rodent_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read in the Portal data files — load_rodent_data","text":"load_rodent_data returns list 5 dataframes: load_plant_data returns list 7 dataframes: load_ant_data returns list 4 dataframes: load_trapping_data returns list 2 dataframes:","code":""},{"path":"https://weecology.github.io/portalr/reference/na_conformer.html","id":null,"dir":"Reference","previous_headings":"","what":"Conform NA entries to ","title":"Conform NA entries to ","text":"Given species abbreviation Neotoma albigula (NA), data read , can NA \"NA\". function conforms entries proper character values.","code":""},{"path":"https://weecology.github.io/portalr/reference/na_conformer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conform NA entries to ","text":"","code":"na_conformer(dfv, colname = \"species\")"},{"path":"https://weecology.github.io/portalr/reference/na_conformer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conform NA entries to ","text":"dfv Either [1] data.frame containing colname column NAs need conformed \"NA\"s [2] vector NAs need conformed \"NA\"s. colname character value column name tab conform NAs \"NA\"s.","code":""},{"path":"https://weecology.github.io/portalr/reference/na_conformer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Conform NA entries to ","text":"x NA colname replaced \"NA\".","code":""},{"path":"https://weecology.github.io/portalr/reference/na_conformer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Conform NA entries to ","text":"","code":"na_conformer(c(\"a\", \"b\", NA, \"c\")) #> [1] \"a\" \"b\" \"NA\" \"c\""},{"path":"https://weecology.github.io/portalr/reference/ndvi.html","id":null,"dir":"Reference","previous_headings":"","what":"NDVI by calendar month or lunar month — ndvi","title":"NDVI by calendar month or lunar month — ndvi","text":"Summarize NDVI data monthly lunar monthly level","code":""},{"path":"https://weecology.github.io/portalr/reference/ndvi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"NDVI by calendar month or lunar month — ndvi","text":"","code":"ndvi( level = \"monthly\", sensor = \"landsat\", fill = FALSE, path = get_default_data_path(), download_if_missing = TRUE )"},{"path":"https://weecology.github.io/portalr/reference/ndvi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"NDVI by calendar month or lunar month — ndvi","text":"level specify \"monthly\" \"newmoon\" sensor specify \"landsat\", \"modis\", \"gimms\", \"\" fill specify missing data filled, passed fill_missing_ndvi path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository download_if_missing specified file path PortalData folder, download ","code":""},{"path":"https://weecology.github.io/portalr/reference/phenocam.html","id":null,"dir":"Reference","previous_headings":"","what":"Phenocam data products by day, calendar month, or lunar month — phenocam","title":"Phenocam data products by day, calendar month, or lunar month — phenocam","text":"Summarize phenocam data products either daily, monthly, lunar monthly level.","code":""},{"path":"https://weecology.github.io/portalr/reference/phenocam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Phenocam data products by day, calendar month, or lunar month — phenocam","text":"","code":"phenocam(level = \"daily\", path = get_default_data_path())"},{"path":"https://weecology.github.io/portalr/reference/phenocam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Phenocam data products by day, calendar month, or lunar month — phenocam","text":"level specify 'monthly', 'daily', 'newmoon' path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository","code":""},{"path":"https://weecology.github.io/portalr/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://weecology.github.io/portalr/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://weecology.github.io/portalr/reference/portalr.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates summaries of the Portal data — portalr","title":"Creates summaries of the Portal data — portalr","text":"package designed interface Portal data, resides online https://github.com/weecology/portalData. contains set functions download, clean, summarize data.","code":""},{"path":[]},{"path":"https://weecology.github.io/portalr/reference/portalr.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Creates summaries of the Portal data — portalr","text":"Maintainer: Glenda M. Yenni glenda@weecology.org (ORCID) Authors: Hao Ye (ORCID) Erica M. Christensen (ORCID) Juniper L. Simonis (ORCID) Ellen K. Bledsoe (ORCID) Renata M. Diaz (ORCID) Shawn D. Taylor (ORCID) Ethan P, White (ORCID) S.K. Morgan Ernest (ORCID) contributors: Weecology [copyright holder]","code":""},{"path":"https://weecology.github.io/portalr/reference/print.html","id":null,"dir":"Reference","previous_headings":"","what":"Prints a portal_data_list object — print.portal_data_list","title":"Prints a portal_data_list object — print.portal_data_list","text":"Prints portal_data_list object","code":""},{"path":"https://weecology.github.io/portalr/reference/print.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prints a portal_data_list object — print.portal_data_list","text":"","code":"# S3 method for class 'portal_data_list' print(x, ...)"},{"path":"https://weecology.github.io/portalr/reference/print.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prints a portal_data_list object — print.portal_data_list","text":"x portal_data_list object. ... arguments passed print","code":""},{"path":"https://weecology.github.io/portalr/reference/return_if_null.html","id":null,"dir":"Reference","previous_headings":"","what":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","title":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","text":"focal input NULL, return value parent function. used within function.","code":""},{"path":"https://weecology.github.io/portalr/reference/return_if_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","text":"","code":"return_if_null(x, value = NULL)"},{"path":"https://weecology.github.io/portalr/reference/return_if_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","text":"x Focal input. value x NULL, return input parent function.","code":""},{"path":"https://weecology.github.io/portalr/reference/return_if_null.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","text":"x NULL, NULL returned. x NULL, result return value input evaluated within parent function's environment returned.","code":""},{"path":"https://weecology.github.io/portalr/reference/return_if_null.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"If a Value is NULL, Trigger the Parent Function's Return — return_if_null","text":"","code":"ff <- function(x = 1, null_return = \"hello\"){ return_if_null(x, null_return) x } ff() #> [1] 1 ff(NULL) #> [1] \"hello\""},{"path":"https://weecology.github.io/portalr/reference/rodent_species.html","id":null,"dir":"Reference","previous_headings":"","what":"Rodent species abbreviations — rodent_species","title":"Rodent species abbreviations — rodent_species","text":"Creates simple character vector abbreviations Portal Rodents.","code":""},{"path":"https://weecology.github.io/portalr/reference/rodent_species.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Rodent species abbreviations — rodent_species","text":"","code":"rodent_species( path = get_default_data_path(), type = \"code\", set = \"all\", total = FALSE ) forecasting_species( path = get_default_data_path(), total = FALSE, type = \"abbreviation\" )"},{"path":"https://weecology.github.io/portalr/reference/rodent_species.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Rodent species abbreviations — rodent_species","text":"path character Folder data downloaded. type character value indicating output type. Current options include 'abbreviation' 'code' (default, two-letter abbreviation), 'g_species' (abbreviated genus species), 'Latin' (full scientific names), 'common' (common names), 'table' (data.frame options). set character input specified set species. Options include \"\" (default, species included) \"forecasting\" (species used forecating pipelines). total logical value indicating \"total\" added .","code":""},{"path":"https://weecology.github.io/portalr/reference/rodent_species.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Rodent species abbreviations — rodent_species","text":"character vector species abbreviations.","code":""},{"path":"https://weecology.github.io/portalr/reference/shrub_cover.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate percent cover from Portal plant transect data — shrub_cover","title":"Generate percent cover from Portal plant transect data — shrub_cover","text":"function calculates percent cover transect data. handles pre-2015 data differently current transects, becase collected differently. returns single time-series years transect data available. also returns mean height beginning 2015.","code":""},{"path":"https://weecology.github.io/portalr/reference/shrub_cover.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate percent cover from Portal plant transect data — shrub_cover","text":"","code":"shrub_cover( path = get_default_data_path(), type = \"Shrubs\", plots = \"all\", unknowns = FALSE, correct_sp = TRUE, download_if_missing = TRUE, quiet = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/shrub_cover.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate percent cover from Portal plant transect data — shrub_cover","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository type specify subset species; type=Annuals, removes non-annual species. type=Summer Annuals, returns annual species can found summer type=Winter Annuals, returns annual species can found winter type=Non-woody, removes shrub subshrub species type=Perennials, returns perennial species (includes shrubs subshrubs) type=Shrubs, returns shrubs subshrubs plots specify subset plots; can vector plots, specific sets: \"\" plots \"Longterm\" plots (plots treatment entire time series) unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE) correct_sp correct species names suspected incorrect early data (T/F) download_if_missing specified file path PortalData folder, download quiet logical, whether run without version messages","code":""},{"path":"https://weecology.github.io/portalr/reference/shrub_cover.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate percent cover from Portal plant transect data — shrub_cover","text":"data.frame percent cover mean height","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_individual_rodents.html","id":null,"dir":"Reference","previous_headings":"","what":"Return cleaned Portal rodent individual data — summarize_individual_rodents","title":"Return cleaned Portal rodent individual data — summarize_individual_rodents","text":"function cleans subsets data based number arguments. returns stake number individual level data.","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_individual_rodents.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return cleaned Portal rodent individual data — summarize_individual_rodents","text":"","code":"summarize_individual_rodents( path = get_default_data_path(), clean = TRUE, type = \"Rodents\", length = \"all\", unknowns = FALSE, time = \"period\", fillweight = FALSE, min_plots = 1, min_traps = 1, download_if_missing = TRUE, quiet = FALSE ) summarise_individual_rodents( path = get_default_data_path(), clean = TRUE, type = \"Rodents\", length = \"all\", unknowns = FALSE, time = \"period\", fillweight = FALSE, min_plots = 1, min_traps = 1, download_if_missing = TRUE, quiet = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/summarize_individual_rodents.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return cleaned Portal rodent individual data — summarize_individual_rodents","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository clean logical, load QA/QC rodent data (TRUE) data (FALSE) type specify subset species; either \"Rodents\" \"Granivores\" length specify subset plots; use \"\" plots \"Longterm\" plots (deprecated) unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE) time specify format time index output, either \"period\" (sequential Portal surveys), \"newmoon\" (lunar cycle numbering), \"date\" (calendar date), \"\" (time indices) fillweight specify whether fill unknown weights records individual species, possible min_plots minimum number plots within period observation included min_traps minimum number traps plot included download_if_missing specified file path PortalData folder, download quiet logical, whether run without producing messages","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_individual_rodents.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return cleaned Portal rodent individual data — summarize_individual_rodents","text":"data.frame","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_plant_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate summaries of Portal plant data — summarize_plant_data","title":"Generate summaries of Portal plant data — summarize_plant_data","text":"function generic interface creating summaries Portal plant species data. contains number arguments specify kind data summarize, level aggregation, various choices dealing data quality, output format. plant_abundance generates table plant abundance","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_plant_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate summaries of Portal plant data — summarize_plant_data","text":"","code":"summarize_plant_data( path = get_default_data_path(), level = \"Site\", type = \"All\", length = \"all\", plots = length, unknowns = FALSE, correct_sp = TRUE, shape = \"flat\", output = \"abundance\", na_drop = switch(tolower(level), quadrat = FALSE, plot = FALSE, treatment = TRUE, site = TRUE, TRUE), zero_drop = switch(tolower(level), quadrat = TRUE, plot = FALSE, treatment = TRUE, site = TRUE, TRUE), min_quads = 1, effort = TRUE, download_if_missing = TRUE, quiet = FALSE ) plant_abundance(..., shape = \"flat\") summarise_plant_data( path = get_default_data_path(), level = \"Site\", type = \"All\", length = \"all\", plots = length, unknowns = FALSE, correct_sp = TRUE, shape = \"flat\", output = \"abundance\", na_drop = switch(tolower(level), quadrat = FALSE, plot = FALSE, treatment = TRUE, site = TRUE, TRUE), zero_drop = switch(tolower(level), quadrat = TRUE, plot = FALSE, treatment = TRUE, site = TRUE, TRUE), min_quads = 1, effort = TRUE, download_if_missing = TRUE, quiet = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/summarize_plant_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate summaries of Portal plant data — summarize_plant_data","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository level summarize \"Plot\", \"Treatment\", \"Site\", \"Quadrat\" type specify subset species; type=Annuals, removes non-annual species. type=Summer Annuals, returns annual species can found summer type=Winter Annuals, returns annual species can found winter type=Non-woody, removes shrub subshrub species type=Perennials, returns perennial species (includes shrubs subshrubs) type=Shrubs, returns shrubs subshrubs length specify subset plots; use \"\" plots \"Longterm\" plots (deprecated) plots specify subset plots; can vector plots, specific sets: \"\" plots \"Longterm\" plots (plots treatment entire time series) unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE) correct_sp correct species names suspected incorrect early data (T/F) shape return data \"crosstab\" \"flat\" list output specify whether return \"abundance\", \"cover\" [cover data starts summer 2015] na_drop logical, drop NA values (representing insufficient sampling) filling missing combinations year-month-treatment/plot-species NA represent one slightly different meanings: 1) combo exist 2) combo skipped month, 3) combo trapped, unusable (negative period code)) zero_drop logical, drop 0s (representing sufficient sampling, detection) min_quads numeric [1:16], minimum number quadrats (16) plot included effort logical whether effort columns included output download_if_missing specified file path PortalData folder, download quiet logical, whether run without version messages ... arguments passed summarize_plant_data","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_plant_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate summaries of Portal plant data — summarize_plant_data","text":"data.frame either \"long\" \"wide\" format, depending value `shape`","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_rodent_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate summaries of Portal rodent data — summarize_rodent_data","title":"Generate summaries of Portal rodent data — summarize_rodent_data","text":"function generic interface creating summaries Portal rodent species data. contains number arguments specify kind data summarize (level aggregation) various choices dealing data quality, output format. abundance generates table rodent abundance * biomass() generates table rodent biomass * energy() generates table rodent energy (computed 5.69 * (biomass ^ 0.75) White et al 2004) * rates() generates table rodent growth rates (computed r=log(N[t+1]/N[t])","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_rodent_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate summaries of Portal rodent data — summarize_rodent_data","text":"","code":"summarize_rodent_data( path = get_default_data_path(), clean = TRUE, level = \"Site\", type = \"Rodents\", length = \"all\", plots = length, unknowns = FALSE, shape = \"crosstab\", time = \"period\", output = \"abundance\", fillweight = (output != \"abundance\"), na_drop = TRUE, zero_drop = switch(tolower(level), plot = FALSE, treatment = TRUE, site = TRUE), min_traps = 1, min_plots = 24, effort = FALSE, download_if_missing = TRUE, quiet = FALSE, include_unsampled = FALSE ) abundance(...) biomass(...) energy(...) rates(...) summarise_rodent_data( path = get_default_data_path(), clean = TRUE, level = \"Site\", type = \"Rodents\", length = \"all\", plots = length, unknowns = FALSE, shape = \"crosstab\", time = \"period\", output = \"abundance\", fillweight = (output != \"abundance\"), na_drop = TRUE, zero_drop = switch(tolower(level), plot = FALSE, treatment = TRUE, site = TRUE), min_traps = 1, min_plots = 24, effort = FALSE, download_if_missing = TRUE, quiet = FALSE, include_unsampled = FALSE )"},{"path":"https://weecology.github.io/portalr/reference/summarize_rodent_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate summaries of Portal rodent data — summarize_rodent_data","text":"path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository clean logical, load QA/QC rodent data (TRUE) data (FALSE) level summarize \"Plot\", \"Treatment\", \"Site\" type specify subset species; either \"Rodents\" \"Granivores\" length specify subset plots; use \"\" plots \"Longterm\" plots (deprecated) plots specify subset plots; can vector plots, specific sets: \"\" plots \"Longterm\" plots (plots treatment entire time series) unknowns either removes individuals identified species (unknowns = FALSE) sums additional column (unknowns = TRUE) shape return data \"crosstab\" \"flat\" list time specify format time index output, either \"period\" (sequential Portal surveys), \"newmoon\" (lunar cycle numbering), \"date\" (calendar date), \"\" (time indices) output specify whether return \"abundance\", \"biomass\", \"energy\", \"rates\" fillweight specify whether fill unknown weights records individual species, possible na_drop logical, drop NA values (representing insufficient sampling) filling missing combinations year-month-treatment/plot-species NA represent one slightly different meanings: 1) combo exist 2) combo skipped month, 3) combo trapped, unusable (negative period code)) zero_drop logical, drop 0s (representing sufficient sampling, detection) min_traps minimum number traps plot included min_plots minimum number plots within period observation included effort logical whether effort columns included output download_if_missing specified file path PortalData folder, download quiet logical, whether run without producing messages include_unsampled logical, overrides settings `na_drop` `zero_drop`, setting FALSE ... arguments passed summarize_rodent_data","code":""},{"path":"https://weecology.github.io/portalr/reference/summarize_rodent_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate summaries of Portal rodent data — summarize_rodent_data","text":"data.frame either \"long\" \"wide\" format, depending value `shape`","code":""},{"path":"https://weecology.github.io/portalr/reference/use_default_data_path.html","id":null,"dir":"Reference","previous_headings":"","what":"Manage the default path for downloading Portal Data into — check_default_data_path","title":"Manage the default path for downloading Portal Data into — check_default_data_path","text":"check_default_data_path checks default data path set, prompts user set missing. get_default_data_path gets value data path environmental variable use_default_data_path 3 steps. First, checks presence pre-existing setting environmental variable. checks folder exists creates , needed. provides instructions setting environmental variable.","code":""},{"path":"https://weecology.github.io/portalr/reference/use_default_data_path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manage the default path for downloading Portal Data into — check_default_data_path","text":"","code":"check_default_data_path( ENV_VAR = \"PORTALR_DATA_PATH\", MESSAGE_FUN = message, DATA_NAME = \"Portal data\" ) get_default_data_path(fallback = \"~\", ENV_VAR = \"PORTALR_DATA_PATH\") use_default_data_path(path = NULL, ENV_VAR = \"PORTALR_DATA_PATH\")"},{"path":"https://weecology.github.io/portalr/reference/use_default_data_path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manage the default path for downloading Portal Data into — check_default_data_path","text":"ENV_VAR environmental variable check (default `\"PORTALR_DATA_PATH\"“) MESSAGE_FUN function use output messages DATA_NAME name dataset use output messages fallback default value use setting missing path character Folder data downloaded.","code":""},{"path":"https://weecology.github.io/portalr/reference/use_default_data_path.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Manage the default path for downloading Portal Data into — check_default_data_path","text":"FALSE path set, TRUE otherwise None","code":""},{"path":"https://weecology.github.io/portalr/reference/weather.html","id":null,"dir":"Reference","previous_headings":"","what":"Weather by day, calendar month, or lunar month — weather","title":"Weather by day, calendar month, or lunar month — weather","text":"Summarize hourly weather data either daily, monthly, lunar monthly level.","code":""},{"path":"https://weecology.github.io/portalr/reference/weather.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Weather by day, calendar month, or lunar month — weather","text":"","code":"weather( level = \"daily\", fill = FALSE, horizon = 365, temperature_limit = 4, path = get_default_data_path() )"},{"path":"https://weecology.github.io/portalr/reference/weather.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Weather by day, calendar month, or lunar month — weather","text":"level specify 'monthly', 'daily', 'newmoon' fill specify missing data filled, passed fill_missing_weather horizon Horizon (number days) use calculating cumulative values (eg warm weather precip) temperature_limit Temperature limit (C) use calculating cumulative values (eg warm weather precip) path either file path contains PortalData folder \"repo\", pulls data PortalData GitHub repository","code":""},{"path":"https://weecology.github.io/portalr/news/index.html","id":"portalr-042","dir":"Changelog","previous_headings":"","what":"portalr 0.4.2","title":"portalr 0.4.2","text":"CRAN release: 2024-08-28 2024-08-08 portalr now uses testthat 3rd edition portalr longer imports clisymbols crayon. messages generated cli. format_todo(), format_code(), format_value() can replaced inline markup (.e. {.val}, {.code}, etc.) may removed package.","code":""},{"path":"https://weecology.github.io/portalr/news/index.html","id":"portalr-041","dir":"Changelog","previous_headings":"","what":"portalr 0.4.1","title":"portalr 0.4.1","text":"CRAN release: 2023-08-23 2023-08-23","code":""},{"path":[]},{"path":"https://weecology.github.io/portalr/news/index.html","id":"portalr-040","dir":"Changelog","previous_headings":"","what":"portalr 0.4.0","title":"portalr 0.4.0","text":"CRAN release: 2023-04-21 2023-04-21","code":""},{"path":[]},{"path":"https://weecology.github.io/portalr/news/index.html","id":"download_observations-argument-update-0-4-0","dir":"Changelog","previous_headings":"","what":"download_observations argument update","title":"portalr 0.4.0","text":"from_zenodo replaced source","code":""},{"path":"https://weecology.github.io/portalr/news/index.html","id":"get_future_moons-replaced-with-get_future_newmoons-0-4-0","dir":"Changelog","previous_headings":"","what":"get_future_moons replaced with get_future_newmoons","title":"portalr 0.4.0","text":"arguments updated moons num_future_moons newmoons nfuture_newmoons now defaulty number moons add NULL call return_if_null ","code":""},{"path":"https://weecology.github.io/portalr/news/index.html","id":"addition-of-new-functions-pulled-from-portalcasting-0-4-0","dir":"Changelog","previous_headings":"","what":"addition of new functions (pulled from portalcasting)","title":"portalr 0.4.0","text":"return_if_null() rodent_species(): helper function now operates rodent table, hard-coded na_conformer(): makes sure species abbreviation Neotoma albigula character value","code":""}]