Skip to content

Commit

Permalink
Update tidyverse.R
Browse files Browse the repository at this point in the history
  • Loading branch information
loreabad6 authored Sep 2, 2024
1 parent 2047715 commit 0d606c7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/tidyverse.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# convert arrays to data.frame, in long form
to_df = function(x) {
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
if(any(sapply(out, inherits, "sfc"))) sf::st_as_sf(out) else out
}

set_dim = function(x, d) {
Expand Down

0 comments on commit 0d606c7

Please sign in to comment.