Skip to content

Commit ab036cb

Browse files
teunbrandthomasp85
authored andcommitted
unclass raster data before calculating resolution (#5638)
1 parent 3532ddd commit ab036cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/geom-raster.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ GeomRaster <- ggproto("GeomRaster", Geom,
9494
}
9595

9696
# Convert vector of data to raster
97-
x_pos <- as.integer((data$x - min(data$x)) / resolution(data$x, FALSE))
98-
y_pos <- as.integer((data$y - min(data$y)) / resolution(data$y, FALSE))
97+
x_pos <- as.integer((data$x - min(data$x)) / resolution(unclass(data$x), FALSE))
98+
y_pos <- as.integer((data$y - min(data$y)) / resolution(unclass(data$y), FALSE))
9999

100100
data <- coord$transform(data, panel_params)
101101

0 commit comments

Comments
 (0)