Learn R Programming

crawl (version 2.2.0)

crw_as_sf: Coerce to sf/sfc object

Description

Provides reliable conversion of "crwIS" and "crwPredict" objects into simple features objects supported in the "sf" package. Both "sf" objects with "POINT" geometry and "sfc_LINESTRING" objects are created. Coersion of "crwPredict" objects to "sfc_LINESTRING" has an option "group" argument when the "crwPredict" object includes predictions from multiple deployments. The grouping column will be used and a tibble of multiple "sf_LINESTRING" objects will be returned

Usage

crw_as_sf(crw_object, ftype, locType, group)

# S3 method for crwIS crw_as_sf(crw_object, ftype, locType = c("p", "o"), group = NULL, ...)

# S3 method for crwPredict crw_as_sf(crw_object, ftype, locType = c("p", "o"), group = NULL, ...)

Arguments

crw_object

an object of class "crwIS" or "crwPredict"

ftype

character of either "POINT" or "LINESTRING" specifying the feature type

locType

character vector of location points to include ("p","o")

group

(optional) character specifying the column to group by for mulitple LINESTRING features

...

Additional arguments that are ignored

Methods (by class)

  • crwIS: coerce crwIS object to sf (POINT or LINESTRING geometry)

  • crwPredict: coerce crwPredict object to sf (POINT or LINESTRING geometry)