npe_community_matrix {neonPlantEcology} | R Documentation |
Create a species abundance or occurrence matrix
Description
npe_community_matrix creates a wide matrix of species cover or binary (presence/absence) values with the plot/subplot/year as rownames. This is useful for the vegan package, hence the name.
Usage
npe_community_matrix(
x,
scale = "plot",
trace_cover = 0.5,
timescale = "annual",
input = "neon_div_object",
binary = FALSE
)
Arguments
x |
Input object. See input argument help for more details. |
scale |
what level of aggregation? This can be "1m", "10m", "100m", "plot", which is the default, or "site". |
trace_cover |
cover value for subplots where only occupancy was recorded |
timescale |
what temporal resolution? can be "subannual", which is really only applicable at sites where there are multiple bouts per year, "annual" or "all", which dissolves together the entire time series. |
input |
by default, longform dataframe is calculated from the diversity object and then converted to a community matrix, set this option to "lf" to use a longform data frame that was created separately (and perhaps modified). Another option is input = "divStack", which is using the output from the divStack function in the neonPlants package. Using a premade longform data frame or a divStack output will use the spatial and temporal scale of that input data separately |
binary |
should the matrix be converted from percent cover to binary? |
neon_div_object |
the raw diversity data downloaded using neonPlantEcology::download_plant_div() or the function neonUtilities::loadByProduct() with the dpID arguement set to "DP1.10058.001". |
Value
a data frame with each row a site aggregated at the spatial and temporal scales chosen by the user. Each column is a single species, and cell values can be either cover (a value between 0 and 100) or occurrence (1 or 0)
Examples
data("D14")
comm <- npe_community_matrix(D14)