transform.sf: transform method for sf objects

transform.sfR Documentation

transform method for sf objects

Description

Can be used to create or modify attribute variables; for transforming geometries see st_transform, and all other functions starting with st_.

Usage

## S3 method for class 'sf'
transform(`_data`, ...)

Arguments

_data

object of class sf

...

Further arguments of the form new_variable = expression

Examples

a = data.frame(x1 = 1:3, x2 = 5:7)
st_geometry(a) = st_sfc(st_point(c(0,0)), st_point(c(1,1)), st_point(c(2,2)))
transform(a, x1_sq = x1^2)
transform(a, x1_x2 = x1*x2)

r-spatial/sf documentation built on April 23, 2024, 8:36 a.m.