View source: R/one_point_per_pixel.R
one_point_per_pixel | R Documentation |
The one_point_per_pixel
function retains only one point per raster pixel. This function is useful
when creating present-absent models.
one_point_per_pixel(
df,
raster = NA,
resolution = 0.5,
precision = TRUE,
digits = 2,
longitude = "longitude",
latitude = "latitude"
)
df |
Data frame of occurrence records. |
raster |
Raster object which will be used for ecological niche comparisons. A SpatRaster should be used. |
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 |
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. |
This function requires package raster and spatstat.geom.
df is a data frame with only one point per pixel.
Information about the columns in the returned data frame can be found in the documentation for gators_download()
.
ready_data <- one_point_per_pixel(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.