occ.desaggregation.RASTER: Remove duplicated points falling into the same raster cell

View source: R/occ.desaggregation.RASTER.R

occ.desaggregation.RASTERR Documentation

Remove duplicated points falling into the same raster cell

Description

The function removes duplicated points falling into the same raster cell.

Usage

occ.desaggregation.RASTER(df, colxy, rast, plot=TRUE)

Arguments

df

a matrix or data.frame containing the points coordinates.

colxy

a numeric vector indicating the IDs of the x-y columns.

rast

a RasterLayer object to be used as base raster map.

plot

a logical vector indicating if a plot must be displayed.

Value

A matrix including the reduced points

Author(s)

Mirko Di Febbraro

Examples


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)



francesco-carotenuto/EcoPast documentation built on April 16, 2023, 5:48 p.m.