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

Description Usage Arguments Value Author(s) Examples

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

Description

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

Usage

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

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
library(raster)
raster(system.file("exdata/prediction_ground.gri", package="DeepTime"))->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=T)


## End(Not run)

francesco-carotenuto/PaleoMacroEco documentation built on Dec. 23, 2019, 6:36 p.m.