Timeline for How to set a geometry to NA (empty) for some features of an sf dataframe in R
Current License: CC BY-SA 4.0
2 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 8, 2023 at 20:16 | comment | added | Faustin Gashakamba |
Thank you very much. This solves my problem. Now for a follow up question, I would now want to replace these empty geometries I just created with point geometries created from XY coordinates created in columns name X and Y respectively. my_points %<>% mutate(geometry= if_else(st_is_empty(geometry), st_sfc(st_point(c(X, Y))), geometry)) . I really don't know why it's not working. I scrolled through half of SO without luck now.
|
|
May 8, 2023 at 19:23 | history | answered | Spacedman | CC BY-SA 4.0 |