one_point_per_pixel: Spatial Correction - One point per pixel
Description
The one_point_per_pixel function retains only one point per raster pixel. This function is useful
for creating present-absent models.
Usage
one_point_per_pixel(
df,
raster = NA,
resolution = 0.5,
precision = TRUE,
digits = 2,
longitude = "longitude",
latitude = "latitude"
)
Value
df is a data frame with only one point per pixel.
Arguments
- df
Data frame of occurrence records.
- raster
Raster object which will be used for ecological niche comparisons.
- resolution
Default = 0.5. Options - 0.5, 2.5, 5, and 10 (in min of a degree). 0.5 min of a degree is equal to 30 arc sec.
- precision
Default = TRUE. Indicates that coordinates should be rounded to match the coordinate uncertainty.
- digits
Default = 2. Indicates digits to round coordinates to when precision = TRUE.
- longitude
Default = "longitude". The name of the longitude column in the data frame.
- latitude
Default = "latitude". The name of the latitude column in the data frame.
Details
This function requires package raster and spatstat.geom.
Examples
Run this codeready_data <- one_point_per_pixel(data)
Run the code above in your browser using DataLab