crw_as_sf: Coerce to sf/sfc object

View source: R/crw_coerce_sf.R

crw_as_sfR Documentation

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. Coercion 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(data, ftype, locType, group)

## S3 method for class 'crwIS'
crw_as_sf(data, ftype, locType = c("p", "o", "f"), group = NULL, ...)

## S3 method for class 'crwPredict'
crw_as_sf(data, ftype, locType = c("p", "o", "f"), group = NULL, ...)

## S3 method for class 'list'
crw_as_sf(data, ftype, locType = c("p", "o", "f"), ...)

Arguments

data

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 multiple LINESTRING features

...

Additional arguments that are ignored

Methods (by class)

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

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

  • crw_as_sf(list): coerce list of crwIS objects to sf (LINESTRING or MULTILINESTRING geometry)


crawl documentation built on Oct. 10, 2022, 1:07 a.m.