diff --git a/R/tidyverse.R b/R/tidyverse.R index 7e0a06b4..c56f30f2 100644 --- a/R/tidyverse.R +++ b/R/tidyverse.R @@ -1,6 +1,7 @@ # convert arrays to data.frame, in long form to_df = function(x) { - dplyr::as_tibble(lapply(x, function(y) structure(y, dim = NULL))) + out = dplyr::as_tibble(lapply(x, function(y) structure(y, dim = NULL))) + if(any(sapply(out, inherits, "sfc"))) sf::st_as_sf(out) else out } set_dim = function(x, d) {