powered by
Can be used to create or modify attribute variables; for transforming geometries see st_transform, and all other functions starting with st_.
st_
# S3 method for sf transform(`_data`, ...)
object of class sf
sf
Further arguments of the form new_variable = expression
new_variable = expression
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)
Run the code above in your browser using DataLab