Skip to content

Commit

Permalink
r
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Oct 3, 2024
1 parent 97679be commit db47db0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/extract_single.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ make_extract_index <- function(v, vmx, name="i") {
if (!drop) {
rc <- rowColFromCell(x, i)
e <- ext_from_rc(x, min(rc[,1]), max(rc[,1]), min(rc[,2]), max(rc[,2]))
y <- crop(rast(x), e)
y[cellFromXY(y, xyFromCell(x, i))] <- x[i]
y <- crop(x, e)
y[-cellFromXY(y, xyFromCell(x, i))] <- NA
y
} else {
e <- x@ptr$extractCell(i-1)
messages(x, "extract")
x <- messages(x, "extract")
e <- do.call(cbind, e)
colnames(e) <- names(x)
if (raw) {
Expand Down

0 comments on commit db47db0

Please sign in to comment.