sp_summary {spsurvey} | R Documentation |
Summarize sampling frames, design sites, and analysis data.
Description
sp_summary()
summarizes sampling frames, design sites, and analysis data. The right-hand of the
formula specifies the variables (or factors) to
summarize by. If the left-hand side of the formula is empty, the
summary will be of the distributions of the right-hand side variables. If the left-hand side
of the formula contains a variable, the summary will be of the left-hand size variable
for each level of each right-hand side variable. Equivalent to spsurvey::summary()
; both
are currently maintained for backwards compatibility.
Usage
sp_summary(object, ...)
## Default S3 method:
sp_summary(object, formula = ~1, onlyshow = NULL, ...)
## S3 method for class 'sp_design'
sp_summary(object, formula = ~siteuse, siteuse = NULL, onlyshow = NULL, ...)
Arguments
object |
An object to summarize. When summarizing sampling frames,
an |
... |
Additional arguments to pass to |
formula |
A formula. One-sided formulas are used to summarize the
distribution of numeric or categorical variables. For one-sided formulas,
variable names are placed to the right of |
onlyshow |
A string indicating the single level of the single right-hand side variable for which a summary is requested. This argument is only used when a single right-hand side variable is provided. |
siteuse |
A character vector indicating the design sites
for which summaries are requested in |
Value
If the left-hand side of the formula is empty, a named list containing summaries of the count distribution for each right-hand side variable is returned. If the left-hand side of the formula contains a variable, a named list containing five number summaries (numeric left-hand side) or tables (categorical or factor left hand side) is returned for each right-hand side variable.
Author(s)
Michael Dumelle Dumelle.Michael@epa.gov
Examples
## Not run:
data("NE_Lakes")
sp_summary(NE_Lakes, ELEV ~ 1)
sp_summary(NE_Lakes, ~ ELEV_CAT * AREA_CAT)
sample <- grts(NE_Lakes, 100)
sp_summary(sample, ~ ELEV_CAT * AREA_CAT)
## End(Not run)