Skip to content

Commit

Permalink
Merge pull request #709 from loreabad6/to_df
Browse files Browse the repository at this point in the history
Adapt internatl to_df function to work with sf tidyverse methods
  • Loading branch information
edzer authored Sep 2, 2024
2 parents 8ad9272 + 0d606c7 commit ec1f849
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/tidyverse.R
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down

0 comments on commit ec1f849

Please sign in to comment.