Title: | Create Useful Summaries of the Portal Data |
---|---|
Description: | Download and generate summaries for the rodent, plant, ant, and weather data from the Portal Project. Portal is a long-term (and ongoing) experimental monitoring site in the Chihuahuan desert. The raw data files can be found at <https://github.com/weecology/portaldata>. |
Authors: | Glenda M. Yenni [aut, cre] |
Maintainer: | Glenda M. Yenni <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.4.4 |
Built: | 2025-02-20 02:45:03 UTC |
Source: | https://github.com/weecology/portalr |
Higher-order data summaries, by 6-month seasons, 3-month seasons, or year. Also applies specified functions to the specified summary level.
yearly
generates a table of yearly means
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(...)
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(...)
data |
data frame containing columns: date, period, newmoonnumber, or year and month |
level |
summarize by "Plot", "Treatment", or "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 be in format "y-m-d"), "period", "newmoonnumber", or "yearmon" (data must contain "year" and "month") |
summary_funs |
A function specified by its name (e.g. "mean"). Default is NA (returned with seasons added but not summarized). |
path |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
download_if_missing |
if the specified file path doesn't have the PortalData folder, then download it |
clean |
logical, load only QA/QC rodent data (TRUE) or all data (FALSE) |
... |
arguments passed to |
a data.frame with additional "season" and "year" column, and other columns summarized as specified. If no summary function is specified, "season" and "year" columns are added to original dataframe, as well as a "seasonyear" column which correctly assigns months to seasons for grouping (eg December 2000 in winter 2001, rather than winter 2000).
Get ant species presence/absence by year/plot/stake from bait census data
Bait census data is more consistent over time than the colony census data. This function assumes that all species present in at least one census were censused in all years.
bait_presence_absence( path = get_default_data_path(), level = "Site", download_if_missing = TRUE, quiet = FALSE )
bait_presence_absence( path = get_default_data_path(), level = "Site", download_if_missing = TRUE, quiet = FALSE )
path |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
level |
level at which to summarize data: 'Site', 'Plot', or 'Stake' |
download_if_missing |
if the specified file path doesn't have the PortalData folder, then download it |
quiet |
logical, whether to run without version messages |
data frame with year, species, (plot if applicable), and presence [1, 0]
check_default_data_path
checks if a default data path is
set, and prompts the user to set it if it is missing.
get_default_data_path
gets the value of the data path
environmental variable
use_default_data_path
has 3 steps. First, it checks for
the presence of a pre-existing setting for the environmental variable.
Then it checks if the folder exists and creates it, if needed. Then it
provides instructions for setting the environmental variable.
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")
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")
ENV_VAR |
the environmental variable to check (by default '"PORTALR_DATA_PATH"“) |
MESSAGE_FUN |
the function to use to output messages |
DATA_NAME |
the name of the dataset to use in output messages |
fallback |
the default value to use if the setting is missing |
path |
|
FALSE if there is no path set, TRUE otherwise
None
Check the latest version against the data that exists on the GitHub repo
check_for_newer_data(path = get_default_data_path())
check_for_newer_data(path = get_default_data_path())
path |
Folder in which data will be checked |
bool TRUE if there is a newer version of the data online
This function does basic quality control of the Portal plant
data. It is mainly called from summarize_plant_data
, with
several arguments passed along.
The specific steps it does are, in order: (1) correct species names according to recent vouchers, if requested (2) restrict species to annuals or non-woody (3) remove records for unidentified species (5) exclude the plots that aren't long-term treatments
clean_plant_data( data_tables, type = "All", unknowns = FALSE, correct_sp = TRUE )
clean_plant_data( data_tables, type = "All", unknowns = FALSE, correct_sp = TRUE )
data_tables |
the list of data_tables, returned from calling
|
type |
specify subset of species; If type=Annuals, removes all non-annual species. If type=Non-woody, removes shrub and subshrub species If type=Perennials, returns all perennial species (includes shrubs and subshrubs) If type=Shrubs, returns only shrubs and subshrubs If type=Winter-annual, returns all annuals found in winter IF type=Summer-annual, returns all annuals found in summer |
unknowns |
either removes all individuals not identified to species (unknowns = FALSE) or sums them in an additional column (unknowns = TRUE) |
correct_sp |
T/F whether or not to use likely corrected plant IDs,
passed to |
This function does basic quality control of the Portal rodent
data. It is mainly called from summarize_rodent_data
, with
several arguments passed along.
The specific steps it does are, in order: (1) add in missing weight data (2) remove records with "bad" period codes or plot numbers (3) remove records for unidentified species (4) exclude non-granivores (5) exclude incomplete trapping sessions (6) exclude the plots that aren't long-term treatments
clean_rodent_data( rodent_data, species_table, fillweight = FALSE, type = "Rodents", unknowns = FALSE )
clean_rodent_data( rodent_data, species_table, fillweight = FALSE, type = "Rodents", unknowns = FALSE )
rodent_data |
the raw rodent data table |
species_table |
the species table |
fillweight |
specify whether to fill in unknown weights with other records from that individual or species, where possible |
type |
specify subset of species; either all "Rodents" or only "Granivores" |
unknowns |
either removes all individuals not identified to species (unknowns = FALSE) or sums them in an additional column (unknowns = TRUE) |
Get ant species presence/absence by year/plot/stake from colony census data
Anomalies in ant colony census protocol over the years means that it can be difficult to discern true absences of all species in all years. This function uses information from Portal_ant_species.csv and Portal_ant_dataflags.csv to predict true presence/absence of species per plot per year. If a more conservative estimate is desired, setting the argument 'rare_sp = T' will only include species we are confident were censused regularly. Setting 'rare_sp = F' may include some false absences, since it is unknown if some rare species were censused in all years. Unknowns may also be excluded from output if desired.
colony_presence_absence( path = get_default_data_path(), level = "Site", rare_sp = FALSE, unknowns = FALSE, download_if_missing = TRUE, quiet = FALSE )
colony_presence_absence( path = get_default_data_path(), level = "Site", rare_sp = FALSE, unknowns = FALSE, download_if_missing = TRUE, quiet = FALSE )
path |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
level |
level at which to summarize data: 'Site', 'Plot', or 'Stake' |
rare_sp |
include rare species (T) or not (F). Rare species may or may not have been censused in all years. Setting 'rare_sp = FALSE' gives a more conservative estimate of presence/absence |
unknowns |
include unknown species (TRUE) or not (FALSE). Unknowns include those only identified to genus. |
download_if_missing |
if the specified file path doesn't have the PortalData folder, then download it |
quiet |
logical, whether to run without version messages |
data frame with year, species, (plot if applicable), and presence [1, 0, NA]
Downloads specified version of the Portal data.
download_observations( path = get_default_data_path(), version = "latest", source = "github", quiet = FALSE, verbose = FALSE, pause = 30, timeout = getOption("timeout"), force = FALSE )
download_observations( path = get_default_data_path(), version = "latest", source = "github", quiet = FALSE, verbose = FALSE, pause = 30, timeout = getOption("timeout"), force = FALSE )
path |
|
version |
|
source |
|
quiet |
|
verbose |
|
pause |
Positive |
timeout |
Positive |
force |
|
NULL invisibly.
Forecast ndvi using a seasonal auto ARIMA
fcast_ndvi(hist_ndvi, level, lead, moons = NULL)
fcast_ndvi(hist_ndvi, level, lead, moons = NULL)
hist_ndvi |
historic ndvi data |
level |
specify "monthly" or "newmoon" |
lead |
number of steps forward to forecast |
moons |
moon data (required if level = "newmoon") |
ndvi values are forecast using auto.arima with seasonality (using a Fourier transform)
a data.frame with time and ndvi values
Fill in historic ndvi data to the complete timeseries being fit
fill_missing_ndvi(ndvi, level, last_time, moons = NULL)
fill_missing_ndvi(ndvi, level, last_time, moons = NULL)
ndvi |
ndvi data |
level |
specify "monthly" or "newmoon" |
last_time |
the last time step to have been completed |
moons |
moon data (required if level = "newmoons" and forecasts are needed) |
missing values during the time series are replaced using na.interp, missing values at the end of the time series are forecast using auto.arima with seasonality (using Fourier transform)
a data.frame with time and ndvi values
Determines incomplete censuses by finding dates when some plots were trapped, but others were not.
find_incomplete_censuses(trapping_table, min_plots, min_traps)
find_incomplete_censuses(trapping_table, min_plots, min_traps)
trapping_table |
Data_table of when plots were censused. |
min_plots |
minimum number of plots within a period for an observation to be included |
min_traps |
minimum number of traps for a plot to be included |
Data.table of period codes when not all plots were trapped.
Return Citation for Portal Data
get_dataset_citation()
get_dataset_citation()
An object of class "citation". For more details, see 'citation()'
Get next newmoon dates and assign newmoon numbers for forecasting
get_future_newmoons(newmoons, nfuture_newmoons = NULL)
get_future_newmoons(newmoons, nfuture_newmoons = NULL)
newmoons |
current newmoon table |
nfuture_newmoons |
number of future newmoons to get |
expected newmoons table for requested future newmoons
does checking for whether a particular datafile exists and then reads it in, using na_strings to determine what gets converted to NA. It can also download the dataset if it's missing locally.
load_datafile( datafile, na.strings = "", path = get_default_data_path(), download_if_missing = TRUE, quiet = TRUE, ... )
load_datafile( datafile, na.strings = "", path = get_default_data_path(), download_if_missing = TRUE, quiet = TRUE, ... )
datafile |
the path to the datafile within the folder for Portal data |
na.strings |
a character vector of strings which are to be
interpreted as |
path |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
download_if_missing |
if the specified file path doesn't have the PortalData folder, then download it |
quiet |
logical, whether to perform operations silently |
... |
arguments passed to |
Loads Portal data files from either a user-defined path or the online Github repository. If the user-defined path is un- available, the default option is to download to that location.
load_rodent_data
loads the rodent data files
load_plant_data
loads the plant data files
load_ant_data
loads the ant data files
load_trapping_data
loads just the rodent trapping files
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, ... )
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 |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
download_if_missing |
if the specified file path doesn't have the PortalData folder, then download it |
clean |
logical, load only QA/QC rodent data (TRUE) or all data (FALSE) |
quiet |
logical, whether to run without version messages |
... |
arguments passed to |
load_rodent_data
returns a list of 5 dataframes:
rodent_data |
raw data on rodent captures |
species_table |
species code, names, types |
trapping_table |
when each plot was trapped |
newmoons_table |
pairs census periods with newmoons |
plots_table |
rodent treatment assignments for each plot |
load_plant_data
returns a list of 7 dataframes:
quadrat_data |
raw plant quadrat data |
species_table |
species code, names, types |
census_table |
indicates whether each quadrat was counted in each census; area of each quadrat |
date_table |
start and end date of each plant census |
plots_table |
rodent treatment assignments for each plot |
transect_data |
raw plant transect data with length and height (2015-present) |
oldtransect_data |
raw plant transect data as point counts (1989-2009) |
load_ant_data
returns a list of 4 dataframes:
bait_data |
raw ant bait data |
colony_data |
raw ant colony data |
species_table |
species code, names, types |
plots_table |
treatment assignments for each plot |
load_trapping_data
returns a list of 2 dataframes:
trapping_table |
when each plot was trapped |
newmoons_table |
pairs census periods with newmoons |
Given the species abbreviation Neotoma albigula (NA), when data are read in, there can be an NA
when it should be an "NA"
. This function conforms the entries to be proper character values.
na_conformer(dfv, colname = "species")
na_conformer(dfv, colname = "species")
dfv |
Either [1] a |
colname |
|
x
with any NA
in colname
replaced with "NA"
.
na_conformer(c("a", "b", NA, "c"))
na_conformer(c("a", "b", NA, "c"))
Summarize NDVI data to monthly or lunar monthly level
ndvi( level = "monthly", sensor = "landsat", fill = FALSE, path = get_default_data_path(), download_if_missing = TRUE )
ndvi( level = "monthly", sensor = "landsat", fill = FALSE, path = get_default_data_path(), download_if_missing = TRUE )
level |
specify "monthly" or "newmoon" |
sensor |
specify "landsat", "modis", "gimms", or "all" |
fill |
specify if missing data should be filled, passed to
|
path |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
download_if_missing |
if the specified file path doesn't have the PortalData folder, then download it |
Summarize phenocam data products to either daily, monthly, or lunar monthly level.
phenocam(level = "daily", path = get_default_data_path())
phenocam(level = "daily", path = get_default_data_path())
level |
specify 'monthly', 'daily', or 'newmoon' |
path |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
Prints a portal_data_list object
## S3 method for class 'portal_data_list' print(x, ...)
## S3 method for class 'portal_data_list' print(x, ...)
x |
A portal_data_list object. |
... |
arguments passed to |
If the focal input is NULL
, return value
from the parent function. Should only be used within a function.
return_if_null(x, value = NULL)
return_if_null(x, value = NULL)
x |
Focal input. |
value |
If |
If x
is not NULL
, NULL
is returned. If x
is NULL
, the result of return
with value
as its input evaluated within the parent function's environment is returned.
ff <- function(x = 1, null_return = "hello"){ return_if_null(x, null_return) x } ff() ff(NULL)
ff <- function(x = 1, null_return = "hello"){ return_if_null(x, null_return) x } ff() ff(NULL)
Creates a simple character
vector of abbreviations for the Portal Rodents.
rodent_species( path = get_default_data_path(), type = "code", set = "all", total = FALSE ) forecasting_species( path = get_default_data_path(), total = FALSE, type = "abbreviation" )
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 |
|
type |
|
set |
|
total |
|
character
vector of species abbreviations.
This function calculates percent cover from transect data. It handles the pre-2015 data differently from the current transects, becase they are collected differently. But it returns a single time-series with all years of transect data available. It also returns mean height beginning in 2015.
shrub_cover( path = get_default_data_path(), type = "Shrubs", plots = "all", unknowns = FALSE, correct_sp = TRUE, download_if_missing = TRUE, quiet = FALSE )
shrub_cover( path = get_default_data_path(), type = "Shrubs", plots = "all", unknowns = FALSE, correct_sp = TRUE, download_if_missing = TRUE, quiet = FALSE )
path |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
type |
specify subset of species; If type=Annuals, removes all non-annual species. If type=Summer Annuals, returns all annual species that can be found in the summer If type=Winter Annuals, returns all annual species that can be found in the winter If type=Non-woody, removes shrub and subshrub species If type=Perennials, returns all perennial species (includes shrubs and subshrubs) If type=Shrubs, returns only shrubs and subshrubs |
plots |
specify subset of plots; can be a vector of plots, or specific sets: "all" plots or "Longterm" plots (plots that have had the same treatment for the entire time series) |
unknowns |
either removes all individuals not identified to species (unknowns = FALSE) or sums them in an additional column (unknowns = TRUE) |
correct_sp |
correct species names suspected to be incorrect in early data (T/F) |
download_if_missing |
if the specified file path doesn't have the PortalData folder, then download it |
quiet |
logical, whether to run without version messages |
a data.frame of percent cover and mean height
This function cleans and subsets the data based on a number of arguments. It returns stake number and individual level data.
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 )
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 |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
clean |
logical, load only QA/QC rodent data (TRUE) or all data (FALSE) |
type |
specify subset of species; either all "Rodents" or only "Granivores" |
length |
specify subset of plots; use "All" plots or only "Longterm" plots (to be deprecated) |
unknowns |
either removes all individuals not identified to species (unknowns = FALSE) or sums them in an additional column (unknowns = TRUE) |
time |
specify the format of the time index in the output, either "period" (sequential Portal surveys), "newmoon" (lunar cycle numbering), "date" (calendar date), or "all" (for all time indices) |
fillweight |
specify whether to fill in unknown weights with other records from that individual or species, where possible |
min_plots |
minimum number of plots within a period for an observation to be included |
min_traps |
minimum number of traps for a plot to be included |
download_if_missing |
if the specified file path doesn't have the PortalData folder, then download it |
quiet |
logical, whether to run without producing messages |
a data.frame
This function is a generic interface into creating summaries of the Portal plant species data. It contains a number of arguments to specify both the kind of data to summarize, at what level of aggregation, various choices for dealing with data quality, and output format.
plant_abundance
generates a table of plant abundance
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 )
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 |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
level |
summarize by "Plot", "Treatment", "Site", or "Quadrat" |
type |
specify subset of species; If type=Annuals, removes all non-annual species. If type=Summer Annuals, returns all annual species that can be found in the summer If type=Winter Annuals, returns all annual species that can be found in the winter If type=Non-woody, removes shrub and subshrub species If type=Perennials, returns all perennial species (includes shrubs and subshrubs) If type=Shrubs, returns only shrubs and subshrubs |
length |
specify subset of plots; use "All" plots or only "Longterm" plots (to be deprecated) |
plots |
specify subset of plots; can be a vector of plots, or specific sets: "all" plots or "Longterm" plots (plots that have had the same treatment for the entire time series) |
unknowns |
either removes all individuals not identified to species (unknowns = FALSE) or sums them in an additional column (unknowns = TRUE) |
correct_sp |
correct species names suspected to be incorrect in early data (T/F) |
shape |
return data as a "crosstab" or "flat" list |
output |
specify whether to return "abundance", or "cover" [cover data starts in summer 2015] |
na_drop |
logical, drop NA values (representing insufficient sampling) filling missing combinations of year-month-treatment/plot-species with NA could represent one of a few slightly different meanings: 1) that combo doesn't exist 2) that combo was skipped that month, or 3) that combo was trapped, but is unusable (a negative period code)) |
zero_drop |
logical, drop 0s (representing sufficient sampling, but no detection) |
min_quads |
numeric [1:16], minimum number of quadrats (out of 16) for a plot to be included |
effort |
logical as to whether or not the effort columns should be included in the output |
download_if_missing |
if the specified file path doesn't have the PortalData folder, then download it |
quiet |
logical, whether to run without version messages |
... |
arguments passed to |
a data.frame in either "long" or "wide" format, depending on the value of 'shape'
This function is a generic interface into creating summaries of the Portal rodent species data. It contains a number of arguments to specify the kind of data to summarize (at what level of aggregation) and various choices for dealing with data quality, and output format.
abundance
generates a table of rodent abundance
* biomass()
generates a table of rodent biomass
* energy()
generates a table of rodent energy
(computed as 5.69 * (biomass ^ 0.75) after White et al 2004)
* rates()
generates a table of rodent growth rates
(computed as r=log(N[t+1]/N[t])
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 )
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 |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |
clean |
logical, load only QA/QC rodent data (TRUE) or all data (FALSE) |
level |
summarize by "Plot", "Treatment", or "Site" |
type |
specify subset of species; either all "Rodents" or only "Granivores" |
length |
specify subset of plots; use "All" plots or only "Longterm" plots (to be deprecated) |
plots |
specify subset of plots; can be a vector of plots, or specific sets: "all" plots or "Longterm" plots (plots that have had the same treatment for the entire time series) |
unknowns |
either removes all individuals not identified to species (unknowns = FALSE) or sums them in an additional column (unknowns = TRUE) |
shape |
return data as a "crosstab" or "flat" list |
time |
specify the format of the time index in the output, either "period" (sequential Portal surveys), "newmoon" (lunar cycle numbering), "date" (calendar date), or "all" (for all time indices) |
output |
specify whether to return "abundance", or "biomass", or "energy", or "rates" |
fillweight |
specify whether to fill in unknown weights with other records from that individual or species, where possible |
na_drop |
logical, drop NA values (representing insufficient sampling) filling missing combinations of year-month-treatment/plot-species with NA could represent one of a few slightly different meanings: 1) that combo doesn't exist 2) that combo was skipped that month, or 3) that combo was trapped, but is unusable (a negative period code)) |
zero_drop |
logical, drop 0s (representing sufficient sampling, but no detection) |
min_traps |
minimum number of traps for a plot to be included |
min_plots |
minimum number of plots within a period for an observation to be included |
effort |
logical as to whether or not the effort columns should be included in the output |
download_if_missing |
if the specified file path doesn't have the PortalData folder, then download it |
quiet |
logical, whether to run without producing messages |
include_unsampled |
logical, overrides settings for 'na_drop' and 'zero_drop', setting both to FALSE |
... |
arguments passed to |
a data.frame in either "long" or "wide" format, depending on the value of 'shape'
Summarize hourly weather data to either daily, monthly, or lunar monthly level.
weather( level = "daily", fill = FALSE, horizon = 365, temperature_limit = 4, path = get_default_data_path() )
weather( level = "daily", fill = FALSE, horizon = 365, temperature_limit = 4, path = get_default_data_path() )
level |
specify 'monthly', 'daily', or 'newmoon' |
fill |
specify if missing data should be filled, passed to |
horizon |
Horizon (number of days) to use when calculating cumulative values (eg warm weather precip) |
temperature_limit |
Temperature limit (in C) to use when calculating cumulative values (eg warm weather precip) |
path |
either the file path that contains the PortalData folder or "repo", which then pulls data from the PortalData GitHub repository |