sp_plot {spsurvey} | R Documentation |
Plot sampling frames, design sites, and analysis data.
Description
This function plots sampling frames, design sites, and analysis data.
If the left-hand side of the formula is empty, plots
are of the distributions of the right-hand side variables. If the left-hand side
of the variable contains a variable, plots are of the left-hand size variable
for each level of each right-hand side variable.
This function is largely built on plot.sf()
, and all spsurvey plotting
methods can supply additional arguments to plot.sf()
. For more information on
plotting in sf
, run ?sf::plot.sf()
. Equivalent to spsurvey::plot()
; both
are currently maintained for backwards compatibility.
Usage
sp_plot(object, ...)
## Default S3 method:
sp_plot(
object,
formula = ~1,
xcoord,
ycoord,
crs,
var_args = NULL,
varlevel_args = NULL,
geom = FALSE,
onlyshow = NULL,
fix_bbox = TRUE,
...
)
## S3 method for class 'sp_design'
sp_plot(
object,
sframe = NULL,
formula = ~siteuse,
siteuse = NULL,
var_args = NULL,
varlevel_args = NULL,
geom = FALSE,
onlyshow = NULL,
fix_bbox = TRUE,
...
)
Arguments
object |
An object to plot. When plotting sampling frames or analysis data,
a data frame or |
... |
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 |
xcoord |
Name of the x-coordinate (east-west) in |
ycoord |
Name of y (north-south)-coordinate in |
crs |
Projection code for |
var_args |
A named list. The name of each list element corresponds to a
right-hand side variable in |
varlevel_args |
A named list. The name of each list element corresponds to a
right-hand side variable in |
geom |
Should separate geometries for each level of the right-hand
side |
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. |
fix_bbox |
Should the geometry bounding box be fixed across plots?
If a length-four vector with names "xmin", "ymin", "xmax", and "ymax" and values
indicating bounding box edges, the bounding box will be fixed as |
sframe |
The sampling frame (an |
siteuse |
A character vector of site types to include when plotting design sites.
It can only take on values |
Author(s)
Michael Dumelle Dumelle.Michael@epa.gov
Examples
## Not run:
data("NE_Lakes")
sp_plot(NE_Lakes, formula = ~ELEV_CAT)
sample <- grts(NE_Lakes, 30)
sp_plot(sample, NE_Lakes)
data("NLA_PNW")
sp_plot(NLA_PNW, formula = ~BMMI)
## End(Not run)