Skip to content

Commit

Permalink
fixes #1582
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Aug 8, 2024
1 parent 6ebc745 commit 7fac0dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/rast.R
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ setMethod("rast", signature(x="ANY"),
}
nms <- names(x)
names(x)[1:3] <- c("x", "y", "l")
x <- as.data.frame(x) # so that this also works for tibble #1582
w <- stats::reshape(x, timevar="l", idvar=c("x", "y"), direction="wide")
w <- rast(w, type="xyz", digits=digits, crs=crs, extent=extent)
names(w) <- gsub(paste0(nms[4], "."), "", names(w))
Expand Down

0 comments on commit 7fac0dc

Please sign in to comment.