Converts a dataframe with a column of characters containing the WKT encoded geometries into an sf object. The column is converted to sfc.
Examples
data(Paracou6_2016)
felttrees <- Paracou6_2016 %>%
dplyr::filter(VernName == "wacapou") %>%
dplyr::group_by(idTree) %>%
dplyr::do(LocPts = # inform geometry.
sf::st_point(c(.$Xutm,.$Yutm)) %>%
sf::st_as_text()) %>% # as text to easy join with a non spacial table
tidyr::unnest(LocPts) # here to pass from list to character
inventory <- dplyr::left_join(Paracou6_2016, felttrees, by = "idTree")
Rslt <- getgeometry (inventory, LocPts)
library(ggplot2)
ggplot() +
geom_sf(data = Rslt)