View source: R/calculatePopSummaryStats.R
| calcPopSummaryStats | R Documentation |
Calculates summary statistics for patch population data, including summary statistics about $m$ (minimum, maximum, mean, and variance) for each network and population as a whole, and the number of networks with $m>1$.
calcPopSummaryStats( popdata, summaryvar, rvar = NULL, popvar, weights = "S", nrow, ncol )
popdata |
Data on multiple realizations of patches of the species of interest within the grid of locations (created by |
summaryvar |
Vector of variables for which summary statistics should be calculated. |
rvar |
Vector of ratio variables. The total vector of variables ( |
popvar |
Categorical variable used to identify different populations. |
weights |
A vector giving spatial weight matrix styles to use to calculate the Join Count and Moran's I
statistics. Can take on values "W", "B", "C", "U", "S", and "minmax". See
|
nrow |
the number of rows in the grid that creates the population |
ncol |
the number of columns in the grid that creates the population |
A list of two dataframes, where the first dataframe includes network- and population-specific summary statistics about $m$, summarizes across unique networks as well as unique units within each population, and where the second list includes summary statistics about the summaryvar.
library(magrittr)
library(dplyr)
ovar = c(
"Stricta",
"Pusilla",
"Cactus",
"CACA_on_Pusilla",
"CACA_on_Stricta",
"MEPR_on_Pusilla",
"MEPR_on_Stricta",
"Old_Moth_Evidence_Pusilla",
"Old_Moth_Evidence_Stricta",
"Percent_Cover_Pusilla", #how do I do these? they are occupancy nor abundance
"Percent_Cover_Stricta",
"Height_Pusilla",
"Height_Stricta"
)
summaryvar = ovar
# WHAT WAS I THINK HERE? for grouping variables?
popvar = "n.networks" # c("n.networks", "realization")
# create realizations
x_start = 1
x_end = 30
y_start = 1
y_end = 30
n.networks = c(5, 15, 10, 20, 30, 40)
n.realizations = 1
SpeciesInfo = PlotSurveys_season1
start.seed=1
buffer=5
rvar = c("CACA_on_Stricta", "CACA_on_Pusilla")
cactus.realizations <- createRealizations(x_start, x_end,
y_start, y_end, buffer, n.networks, n.realizations, SpeciesInfo, start.seed,
ovar, "Cactus")
patch_data_summary <- calcPopSummaryStats(popdata=cactus.realizations,
summaryvar=ovar, popvar=popvar, nrow=30, ncol=30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.