View source: R/occ.desaggregation.RASTER.R
occ.desaggregation.RASTER | R Documentation |
The function removes duplicated points falling into the same raster cell.
occ.desaggregation.RASTER(df, colxy, rast, plot=TRUE)
df |
a matrix or data.frame containing the points coordinates. |
colxy |
a numeric vector indicating the IDs of the x-y columns. |
rast |
a |
plot |
a logical vector indicating if a plot must be displayed. |
A matrix including the reduced points
Mirko Di Febbraro
library(raster)
raster(system.file("exdata/prediction_ground.gri", package="EcoPast"))->prediction_ground
data(lgm)
data_mammuth<-subset(lgm, spec=="Mammuthus_primigenius")
coordinates(data_mammuth)<-~x+y
proj4string(data_mammuth)<-"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
data_mammuth<-spTransform(data_mammuth, proj4string(prediction_ground))
data_mammuth<-as.data.frame(data_mammuth)
data_mammuth_reduced<-occ.desaggregation.RASTER(df=data_mammuth, colxy=4:5,
rast=prediction_ground, plot=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.