Learn R Programming

spsurvey (version 5.5.1)

sp_rbind: Combine rows from GRTS or IRS samples.

Description

This function row binds the sites_legacy, sites_base, sites_over, and sites_near objects from a GRTS or IRS sample into a single sf object. This function is most useful when a single sf object that contains all design sites is desired (e.g. writing out a single shapefile using sf::write_sf()).

Usage

sp_rbind(object, siteuse = NULL)

Value

A single sf object containing all requested design sites.

Arguments

object

The design sites (output from grts() or irs()).

siteuse

A character vector of site types to return. Can contain "Legacy" (for legacy sites), "Base" (for base sites), "Over" (for n_over replacement sites), and "Near" (for n_near replacement sites). The default is NULL, which returns all non-NULL output from object$sites_legacy, object$sites_base, object$sites_over, and object$sites_near.

Author

Michael Dumelle Dumelle.Michael@epa.gov

Examples

Run this code
if (FALSE) {
sample <- grts(NE_Lakes, 50, n_over = 10)
sample <- sp_rbind(sample)
write_sf(sample, "mypath/sample.shp")
}

Run the code above in your browser using DataLab