inbo / ClimateCastR

A package to do a rough climate match for horizon scanning
Other
0 stars 0 forks source link

21 create function data thinning #33

Open SanderDevisscher opened 3 months ago

SanderDevisscher commented 3 months ago

Fixes #21 by creating a function that allows users to group points within a cutoff from each other and apply a fun like 'sum' on the n_obs. The function returns a sf object with the same structure as the input x only with fewer rows.

To speed up the function a n parameter has been added allowing the user to define the chunk size in which the distance matrix is calculated. This also allows to process species with high no observations. downside would be the distance matrix is only calculated within a chunk and points close to each other but in other chunks are not grouped as such.

SanderDevisscher commented 3 months ago
SanderDevisscher commented 3 months ago

@soriadelva do you think cutoff is sufficient as coordinateUncertainty ? or should it be 2 x cutoff or cutoff + cutoff/2 ?

image

red = input points blue = grouped point