extract_stack_raster: Extract point information (values) from a stack of raster...

View source: R/AgroSoil_generic_functions.R

extract_stack_rasterR Documentation

Extract point information (values) from a stack of raster files

Description

This function is required to extract pixel values of multiple stacked raster files at specific locations.

Usage

extract_stack_raster(x, y)

Arguments

x

Path to folder containing Raster files

y

Object of class SpatialPoints

Value

Dataframe. A matrix of extracted point location information for respective Raster files

Examples

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)

kanj241/agrosoil documentation built on March 25, 2022, 12:22 a.m.