Skip to content

Commit 2cf06e7

Browse files
committed
Fixed parameter passed to terra::extract as reported by @drakeasberry
1 parent e830b8f commit 2cf06e7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

episodes/11-vector-raster-integration.Rmd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ source("setup.R")
1818

1919
:::::::::::::::::::::::::::::::::::::::: questions
2020

21-
- How can I crop raster objects to vector objects, and extract the summary of raster pixels?
21+
- How can I crop raster objects to vector objects, and extract the summary of
22+
raster pixels?
2223

2324
::::::::::::::::::::::::::::::::::::::::::::::::::
2425

@@ -215,7 +216,8 @@ CHM_plots_HARVcrop <- crop(x = CHM_HARV, y = plot_locations_sp_HARV)
215216
CHM_plots_HARVcrop_df <- as.data.frame(CHM_plots_HARVcrop, xy = TRUE)
216217
217218
ggplot() +
218-
geom_raster(data = CHM_plots_HARVcrop_df, aes(x = x, y = y, fill = HARV_chmCrop)) +
219+
geom_raster(data = CHM_plots_HARVcrop_df,
220+
aes(x = x, y = y, fill = HARV_chmCrop)) +
219221
scale_fill_gradientn(name = "Canopy Height", colors = terrain.colors(10)) +
220222
geom_sf(data = plot_locations_sp_HARV) +
221223
coord_sf()
@@ -322,7 +324,7 @@ We will begin by extracting all canopy height pixel values located within our
322324
Harvard Forest field site.
323325

324326
```{r extract-from-raster}
325-
tree_height <- extract(x = CHM_HARV, y = aoi_boundary_HARV, df = TRUE)
327+
tree_height <- extract(x = CHM_HARV, y = aoi_boundary_HARV, raw = FALSE)
326328
327329
str(tree_height)
328330
```

0 commit comments

Comments
 (0)