st_is: test equality between the geometry type and a class or set of...

Description Usage Arguments Examples

View source: R/cast_sfc.R

Description

test equality between the geometry type and a class or set of classes

Usage

1
st_is(x, type)

Arguments

x

object of class sf, sfc or sfg

type

character; class, or set of classes, to test against

Examples

1
2
3
4
5
6
7
st_is(st_point(0:1), "POINT")
sfc = st_sfc(st_point(0:1), st_linestring(matrix(1:6,,2)))
st_is(sfc, "POINT")
st_is(sfc, "POLYGON")
st_is(sfc, "LINESTRING")
st_is(st_sf(a = 1:2, sfc), "LINESTRING")
st_is(sfc, c("POINT", "LINESTRING"))

sf documentation built on July 24, 2019, 5:05 p.m.