hypertidy / reproj

Reproject with the PROJ library
http://hypertidy.github.io/reproj/
3 stars 0 forks source link

the dplyr multi mutate thing #3

Open mdsumner opened 8 years ago

mdsumner commented 8 years ago

https://gist.github.com/mdsumner/c8ea384fdeca3ff48c5f5c2c192e5ee5

Hadley "it's in my brain" Wickham: https://twitter.com/hadleywickham/status/766623940080828416

mdsumner commented 5 years ago

I just use

x[c("x", "y")] <- op(cbind(x, y)) 

that seems as handy as any other

mdsumner commented 3 years ago

Resurrect this and do like

reproj_df <- function(x, y, crs, ...) {xy <- reproj::reproj(tibble(x = x, y = y), crs, ...); tibble::tibble(x = xy[,1], y = xy[,2])}
tibble(a = "b", x = 1, y = 2) %>% mutate(a, reproj_df(x, y, "+proj=laea", source = 4326))

that would be good, need to preserver the names of the inputs ...