geo_pull: Extract a single column from a geometric object

View source: R/geo_pull.R

geo_pullR Documentation

Extract a single column from a geometric object

Description

This function allows to extract a specific column from any geometric object for which all required getters are available and thus reflects the base function $.

Usage

geo_pull(obj, var, ungroup = FALSE)

Arguments

obj

gridded(1)
the object to pull a column from.

var

character(1)
name of the variable to pull.

ungroup

logical(1)
this argument provides the attribute to pull per each individual feature, producing duplicates in case there is more than one feature per group.

Details

This function searches for var by first looking in the groups, then the features and finally the points of obj. This results always in an output that is limited to the unique cases of var. In case you want the explicit values of, for instance, fid in obj@points, you have to extract points and then use pull on the result.

Value

vector of the column specified in var.

See Also

Other geometry tools: geo_filter(), geo_locate(), geo_reflect(), geo_rotate(), geo_scale(), geo_skew(), geo_stretch(), geo_translate()

Examples

# pull values from a geom (there are two features, thus two values) ...
geo_pull(obj = gtGeoms$point, var = "fid")

# pull from a Raster* with RAT
geo_pull(obj = gtGeoms$grid, var = "cover")

EhrmannS/geometr documentation built on Jan. 31, 2024, 9:13 a.m.