rvalavi / blockCV

The blockCV package creates spatially or environmentally separated training and testing folds for cross-validation to provide a robust error estimation in spatially structured environments. See
https://doi.org/10.1111/2041-210X.13107
GNU General Public License v3.0
107 stars 24 forks source link

Can I specify sample points when envBlock is done on covariates? #11

Closed immaryw closed 4 years ago

immaryw commented 4 years ago

Hi,

Based on my understanding of the function "envBlock", it allows us to use the parameter "rasterBlock" specify cluster on covariates or species data. When clustering is done on covariates, it is based on a certain number (defined by param "sampleNumber") of randomly sampled points from raster layers.

Is it possible to build clusters based on a rasterstack of covariates but from pre-defined sample points that have the same coordinates with the species data? I have presence-absence data points and just want to do clustering on covariates of those points.

Thanks!

rvalavi commented 4 years ago

Hi @immaryw

Thanks for your comment. Well, that's pretty easy! You only need to set rasterBlock = FALSE, then the clustering will be done only on the raster values on the location of the points i.e. values are extracted then clustering is done!

Cheers, Roozbeh

immaryw commented 4 years ago

Thanks for your clarification!

I thought rasterBlock=FALSE made clusters based on response values of species data. I know I misunderstood that now.

Best,

Jing

rvalavi commented 4 years ago

My pleasure! No, it is based on the raster values on the point!

Cheers, Roozbeh