Skip to content

Commit bbfaf8d

Browse files
committed
fix for duplicate points in get checkerboard
1 parent 804ba72 commit bbfaf8d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

R/partitions.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ get.block <- function(occs, bg, orientation = "lat_lon"){
237237

238238
get.checkerboard <- function(occs, envs, bg, aggregation.factor,
239239
gridSampleN = 10000){
240+
message("Removing duplicate points...")
241+
occs <- occs[!duplicated(occs),]
242+
bg <- bg[!duplicated(bg),]
243+
240244
if(is.null(envs)) stop("Cannot use checkerboard partitioning if envs is NULL.")
241245
if(length(aggregation.factor) == 1) {
242246
message("Generating basic checkerboard partitions...")

0 commit comments

Comments
 (0)