Skip to content

Commit

Permalink
fix tidytransit st_agr() problem
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Nov 28, 2023
1 parent fe87116 commit 6e7e571
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/agr.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ st_agr.factor = function(x, ...) {
}

#' @export
st_agr.default = function(x = NA_character_, ...) {
stopifnot(all(is.na(x)))
st_agr.default = function(x = NA_character_, ...) {
if (is.data.frame(x) && !is.null(attr(x, "agr")))
x = attr(x, "agr")
structure(st_agr(as.character(x)), names = names(x))
}

Expand Down

0 comments on commit 6e7e571

Please sign in to comment.