retrieve_predictor: read predictor values at the point locations, returns a...

Description Usage Arguments Examples

View source: R/retrieve_predictor.R

Description

read predictor values at the point locations, returns a dataframe or save into a csv

Usage

1
2
3
4
5
6
7
retrieve_predictor(
  predictorstack,
  pointdatafile,
  coordslonlat,
  proj,
  csvname = "predictors"
)

Arguments

predictorstack

raster stack to read point values from

pointdatafile

the file contains point locations to be read

coordslonlat

a vector specify the names of the longitude and latitude variable names.

proj

the projection of the point file

csvname

the name to save the csv file

Examples

1
2
3
4
5
lus = raster("/data/lu01/NWA/predictor/NLstack.grd")
lf_lo = list.files("/data/lu01/NWA/Bakfietsdata", pattern = "^.*morning.*.csv$", full.names = T)
bakfile1 = read.csv(lf_lo[1])
proj = "+proj=longlat +datum=WGS84"
retrieve_predictor(lus, bakfile1, c("Lon", "Lat"), proj)

mengluchu/APMtools documentation built on Jan. 27, 2022, 2:41 a.m.