View source: R/AgroSoil_generic_functions.R
extract_stack_raster | R Documentation |
This function is required to extract pixel values of multiple stacked raster files at specific locations.
extract_stack_raster(x, y)
x |
Path to folder containing Raster files |
y |
Object of class SpatialPoints |
Dataframe. A matrix of extracted point location information for respective Raster files
library(raster) x <- list.files(path = "foleder containing raster files", pattern = glob2rx("*.file extension"), full.names = TRUE) pnts <- data.frame(Long = c(10:15), Lat = c(1:5)) coordinates(pnts) = ~ Long + Lat proj4string(pnts)<- CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0") y <- pnts extract_stack_raster(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.