Skip to content

Incorrect length of return from get.checkerboard() ? #171

@PopGen33

Description

@PopGen33

Hello,

I've run into a small issue with get.checkerboard(). The output that it generates for $occs.grp is 4 rows longer than the input. I also tried this with a single aggregation factor and got the same result.

> nrow(occ_data_summer)

[1] 35

> nrow(pseudo_data_summer_buffer500)

[1] 10000

> checkerboard_summer <- get.checkerboard(occs = occ_data_summer %>% select(x,y),
+                                         bg = pseudo_data_summer_buffer500 %>% select(x,y),
+                                         envs = explanatory_vars,
+                                         aggregation.factor = c(10,10))

Generating hierarchical checkerboard partitions...

> length(checkerboard_summer$occs.grp)

[1] 39

> length(checkerboard_summer$bg.grp)

[1] 10000

> nrow(occ_data_summer %>% select(x,y))

[1] 35

For context, the 10000 background points are drawn from within 500km of the occurrence points using the predicts::backgroundSample() function and a raster representing a 500km buffer around the occurrences. The 'explanatory_vars' are BioClim rasters at 30 second resolution from CHELSA. The partitioning of the background points works as expected; it's the partitioning o the occurrences themselves that seems to be the problem.

For further evaluation, here are evalplot.grps() plots to visualize the groups:
Background:

Image

Occurences (to deal with the output from get.checkerboard() being the wrong length; I set grp = checkerboard_summer$occs.grp[1:nrow(occ_data_summer)]) ):

Image

So, any insight into why get.checkerboard() is generating the extra rows? Is just ignoring the 4 extra rows (like for the plot above) an acceptable solution?

Thank you for your time. Any help is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions