Description Usage Arguments Value Author(s) Examples
View source: R/fix.coastal.points.R
The function moves points to the nearest non-NA cell of a base raster within a maximum distance.
1 2 | fix.coastal.points(data, xy.cols, r, ncell, clip.by.poly = F, poly,
occ.desaggregation = F)
|
data |
a matrix or data.frame containing the points coordinates |
xy.cols |
a numeric vector indicating the IDs of the x-y columns |
r |
a |
ncell |
an integer indicating the maximum number of cells away from the points where they can be shifted. If the nearest non-NA cell fall farther than this distance from a give point, this will be dropped |
clip.by.poly |
a logical vector indicating if the base raster must be clipped along the boundaries of a polygon |
poly |
a |
occ.desaggregation |
a logical vector indicating if to apply the |
a matrix including the shifted points
Mirko Di Febbraro
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
library(raster)
raster(system.file("exdata/prediction_ground.gri", package="DeepTime"))->prediction_ground
data(lgm)
data_clupus<-subset(lgm, spec=="Canis_lupus")
coordinates(data_clupus)<-~x+y
proj4string(data_clupus)<-"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
data_clupus<-spTransform(data_clupus, proj4string(prediction_ground))
data_clupus<-as.data.frame(data_clupus)
data_mammuth_reduced<-fix.coastal.points(data_clupus, xy.cols = 4:5,
r = prediction_ground, ncell = 1, occ.desaggregation = F)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.