strata_coordinates: Grab coordinates for strata

View source: R/strata_coordinates.R

strata_coordinatesR Documentation

Grab coordinates for strata

Description

This function takes a data.frame, and a stratum and makes a data frame consisting of Stratum, Latitude, and Longitude for each stratum

Usage

strata_coordinates(
  x,
  stratum = "Population",
  longitude = "Longitude",
  latitude = "Latitude",
  as.SpatialPoints = FALSE,
  sort.output = FALSE,
  single.stratum = TRUE
)

Arguments

x

A data.frame object.

stratum

The name of the stratum to partition on (default="Population").

longitude

The column name of the longitude

latitude

The column name of the latitude

as.SpatialPoints

A flag indicating what kind of coordinates to return should be turned into a SpatialPoints object (TRUE) or as a data.frame (FALSE, the default)

sort.output

A flag indicating if the results should be sorted alphabetically (default=FALSE)

single.stratum

A flag to indicate that you only want one entry per stratum (for collapsing points within strata, Default=TRUE).

Value

A data frame, with Stratum Latitude and Longitude, summarized by center of each stratum.

Author(s)

Rodney J. Dyer rjdyer@vcu.edu


dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.