Description Usage Arguments Details Value Author(s) Examples
View source: R/calculate_habitat_change.R
Calculates habitat added or lost between time steps.
1 2 | calculate_habitat_change(tothabitat, flood, time, value, accessible = NULL,
alt = 1, wetsplit = TRUE)
|
tothabitat |
Data frame with two columns: "habitat" giving the names of each land cover type of interest and "area" giving the total area potentially available |
flood |
Long-format data frame with proportion flooded values for each time step and land cover type of interest; land cover names should be in a column named "habitat" |
time |
Name of column in |
value |
Name of column in |
accessible |
Optional; data frame with same structure as |
alt |
Optional; value to be used for land cover types with missing accessibility data, e.g. assume 1 or 0 |
wetsplit |
Optional; if |
This function calculates the total area of open water (and optionally accessible open water) for each land cover type of interest during each time step from the total area of each land cover type and estimates for each time step of the proportion open water (and optionally the proportion of the open water area that is accessible). The function then calculates the daily change in the total area of open water as area added since the last time step and area lost before the start of the next time step. Area added and lost is only calculated for total open water area, not accessible open water area.
The wetsplit
option is useful if proportion accessible varies by wetland type (seasonal vs. permanent) but proportion flooded is only available for all wetlands. If wetsplit=TRUE
, the flood
data frame requires a column labeled "prop.perm" that reflects the proportion of open water wetlands estimated to be permanent wetlands during each time step, and the accessible
data frame requires land cover types (in the "habitat" column) called "seas" and "perm".
Returns a list with 3-5 elements, formatted for input into the bioenergetics modeling function and for plotting, including:
(1) openwater
: total area of open water for each time step (rows) and land cover type (columns)
(2) added
: total area of open water added since the previous time step
(3) returned
: total area of open water lost before the start of the next time step
(4) (optionally) accessible
: total area of accessible open water for each time step and land cover type
(5) (optionally) prop.accessible
: proportion accessible for each time step and land cover type, including alt
values filled in where previously missing
Kristen Dybala, kdybala@pointblue.org
1 2 3 4 5 6 7 8 9 | tot = data.frame(habitat=c('A','B','C'), area=c(100,200,300))
flood = data.frame(habitat=c(rep('A',3),rep('B',3),rep('C',3)), yday=rep(c(1:3),3),
value=c(0.9,0.8,0.7, 0.1,0.15,0.2, 0.5,0.5,0.5))
depth = data.frame(habitat=c(rep('A',3),rep('B',3),rep('C',3)), yday=rep(c(1:3),3),
value=rep(0.9,9))
calculate_habitat_change(tothabitat=tot, flood=flood, time='yday',
value='value', accessible=NULL, alt=0, wetsplit=FALSE)
calculate_habitat_change(tothabitat=tot, flood=flood, time='yday',
value='value', accessible=depth, wetsplit=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.