Description Usage Arguments Details Value Author(s)
View source: R/RL_subset_seasons.R
Subset wide format data to species-season combinations. Also allows copying of data for missing desired seasons.
1 2 3 4 5 6 7 8 9 10 |
x |
A wide format dataframe with one column per habitat category. As output by RL_fetch(). |
season_df |
A dataframe consisting of a column for species and a column for season. A species with multiple seasons desired should have one row per season. See Details. |
query |
Character. Are species represented by names ("name") or IUCN IDs ("ID")? |
species.col.name |
(optional) Character. What column name of |
season.col.name |
(optional) Character. What column name of |
fill.missing.seasons |
(optional) Vector. If seasons are present in |
retain.na.seasons |
(optional) Logical. Some seasons are coded as NA on the Red List. RL_fetch() pulls these down as 999. Would you like to retain these seasons? Defaults to FALSE. |
retain.missing.sp |
(optional) Logical. If a species is not found in season_df, should it be retained? Defaults to TRUE. |
season_df
should have seasons coded numerically as per redlistManipulatr::seasons$Code
.
If the data for a season doesn't exist on the RedList (e.g. a bird may have breeding season and non-breeding season data but no data for resident), then fill.missing.seasons
lets you say which seasons you want to copy data from. This can include any of the Red List season codes - for instance fill.missing.seasons = c(1,2,5)
would mean that for a season we're missing data for, we look at the data (if it exists) for the resident
, breeding season
, and seasonal occurrence uncertain
seasons and select the most suitable combination - e.g. if resident
has habitat 1.2 as suitable
major importance Yes
and breeding season
has it as marginal
major importance No
then we take the value from resident
because it has a higher suitability.
A dataframe in wide format (one column per habitat type).
Matt Lewis, matthewlewis896@gmail.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.