{"id":354349,"name":"blockCV","description":"Suitable for the evaluation of a variety of spatial modelling applications, including classification of remote sensing imagery, soil mapping, and species distribution modelling.","url":"https://github.com/rvalavi/blockcv","last_synced_at":"2026-08-23T22:03:21.380Z","repository":{"id":31085845,"uuid":"116337503","full_name":"rvalavi/blockCV","owner":"rvalavi","description":"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","archived":false,"fork":false,"pushed_at":"2026-07-27T01:38:28.000Z","size":57806,"stargazers_count":134,"open_issues_count":1,"forks_count":24,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-08-11T16:12:36.285Z","etag":null,"topics":["cross-validation","r","r-package","rstats","spatial","spatial-cross-validation","spatial-modelling","species-distribution-modelling"],"latest_commit_sha":null,"homepage":"https://doi.org/10.1111/2041-210X.13107","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rvalavi.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-01-05T03:38:06.000Z","updated_at":"2026-08-10T18:50:58.000Z","dependencies_parsed_at":"2023-02-18T23:01:45.896Z","dependency_job_id":"6c45ef2e-f44b-432d-afbc-1e91f85b3610","html_url":"https://github.com/rvalavi/blockCV","commit_stats":{"total_commits":269,"total_committers":4,"mean_commits":67.25,"dds":"0.018587360594795488","last_synced_commit":"5ffdeacf8901c30fae17760f4acf8e2f880d7386"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/rvalavi/blockCV","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvalavi","download_url":"https://codeload.github.com/rvalavi/blockCV/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36572154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"online","status_checked_at":"2026-08-12T02:00:07.134Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"owner":{"login":"rvalavi","name":"Roozbeh Valavi","uuid":"30306220","kind":"user","description":"Data science and spatial ecology","email":"","website":"https://scholar.google.co.uk/citations?user=3m0jCHwAAAAJ\u0026hl=en\u0026oi=ao","location":"Melbourne, Australia","twitter":"ValaviRoozbeh","company":"CSIRO Environment","icon_url":"https://avatars.githubusercontent.com/u/30306220?u=7b0211d1a70af08ffe90dc78af97f570f56aa781\u0026v=4","repositories_count":3,"last_synced_at":"2023-03-01T14:15:25.198Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/rvalavi","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2022-11-12T11:28:08.139Z","updated_at":"2023-03-01T14:15:25.213Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvalavi","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvalavi/repositories"},"packages":[{"id":431074,"name":"blockCV","ecosystem":"cran","description":"Spatial and Environmental Blocking for Cross-Validation","homepage":"https://github.com/rvalavi/blockCV","licenses":"GPL (≥ 3)","normalized_licenses":["CNRI-Python-GPL-Compatible"],"repository_url":"https://github.com/rvalavi/blockCV","keywords_array":[],"namespace":null,"versions_count":11,"first_release_published_at":"2020-02-23T21:00:00.000Z","latest_release_published_at":"2021-06-17T00:00:00.000Z","latest_release_number":"2.1.4","last_synced_at":"2026-08-22T21:30:39.818Z","created_at":"2022-04-06T21:25:21.985Z","updated_at":"2026-08-23T00:47:33.405Z","registry_url":"https://cran.r-project.org/package=blockCV","install_command":null,"documentation_url":"http://cran.r-project.org/web/packages/blockCV/blockCV.pdf","metadata":{},"repo_metadata":{"id":31085845,"uuid":"116337503","full_name":"rvalavi/blockCV","owner":"rvalavi","description":"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","archived":false,"fork":false,"pushed_at":"2026-07-27T01:38:28.000Z","size":57806,"stargazers_count":134,"open_issues_count":1,"forks_count":24,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-08-11T16:12:36.285Z","etag":null,"topics":["cross-validation","r","r-package","rstats","spatial","spatial-cross-validation","spatial-modelling","species-distribution-modelling"],"latest_commit_sha":null,"homepage":"https://doi.org/10.1111/2041-210X.13107","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rvalavi.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-01-05T03:38:06.000Z","updated_at":"2026-08-10T18:50:58.000Z","dependencies_parsed_at":"2023-02-18T23:01:45.896Z","dependency_job_id":"6c45ef2e-f44b-432d-afbc-1e91f85b3610","html_url":"https://github.com/rvalavi/blockCV","commit_stats":{"total_commits":269,"total_committers":4,"mean_commits":67.25,"dds":"0.018587360594795488","last_synced_commit":"5ffdeacf8901c30fae17760f4acf8e2f880d7386"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/rvalavi/blockCV","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvalavi","download_url":"https://codeload.github.com/rvalavi/blockCV/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36572155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"online","status_checked_at":"2026-08-12T02:00:07.134Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"},"owner_record":{"login":"rvalavi","name":"Roozbeh Valavi","uuid":"30306220","kind":"user","description":"Data science and spatial ecology","email":"","website":"https://scholar.google.co.uk/citations?user=3m0jCHwAAAAJ\u0026hl=en\u0026oi=ao","location":"Melbourne, Australia","twitter":"ValaviRoozbeh","company":"CSIRO Environment","icon_url":"https://avatars.githubusercontent.com/u/30306220?u=7b0211d1a70af08ffe90dc78af97f570f56aa781\u0026v=4","repositories_count":3,"last_synced_at":"2023-03-01T14:15:25.198Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/rvalavi","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2022-11-12T11:28:08.139Z","updated_at":"2023-03-01T14:15:25.213Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvalavi","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvalavi/repositories"},"tags":[{"name":"v2.1.0","sha":"3d5dae4951b2b71504ff4e0a4ce53ad61d8c26c5","kind":"commit","published_at":"2020-01-28T08:54:23.000Z","download_url":"https://codeload.github.com/rvalavi/blockCV/tar.gz/v2.1.0","html_url":"https://github.com/rvalavi/blockCV/releases/tag/v2.1.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/rvalavi/blockCV@v2.1.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/tags/v2.1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/tags/v2.1.0/manifests"},{"name":"v2.0.1","sha":"d07d5312e8f4184f85688a7a8668204a472d0c17","kind":"commit","published_at":"2019-11-11T02:11:22.000Z","download_url":"https://codeload.github.com/rvalavi/blockCV/tar.gz/v2.0.1","html_url":"https://github.com/rvalavi/blockCV/releases/tag/v2.0.1","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/rvalavi/blockCV@v2.0.1","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/tags/v2.0.1","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/tags/v2.0.1/manifests"},{"name":"v2.0","sha":"731f961acb5ab01b43ce5b995541b9734a1df329","kind":"commit","published_at":"2019-09-24T00:21:08.000Z","download_url":"https://codeload.github.com/rvalavi/blockCV/tar.gz/v2.0","html_url":"https://github.com/rvalavi/blockCV/releases/tag/v2.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/rvalavi/blockCV@v2.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/tags/v2.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/tags/v2.0/manifests"},{"name":"v1.0","sha":"4f15c8eaea54b21de378a52dcda980f5f658145a","kind":"commit","published_at":"2018-09-27T01:58:32.000Z","download_url":"https://codeload.github.com/rvalavi/blockCV/tar.gz/v1.0","html_url":"https://github.com/rvalavi/blockCV/releases/tag/v1.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/rvalavi/blockCV@v1.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/tags/v1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/tags/v1.0/manifests"}]},"repo_metadata_updated_at":"2026-08-23T00:47:33.405Z","dependent_packages_count":8,"downloads":4005,"downloads_period":"last-month","dependent_repos_count":10,"rankings":{"downloads":13.895902547065338,"dependent_repos_count":9.246787771377935,"dependent_packages_count":6.614975631369075,"stargazers_count":3.937984496124031,"forks_count":3.5976960567124503,"docker_downloads_count":27.563136907399205,"average":10.809413901674672},"purl":"pkg:cran/blockCV","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/cran/blockCV","docker_dependents_count":1,"docker_downloads_count":8,"usage_url":"https://repos.ecosyste.ms/usage/cran/blockCV","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/cran/blockCV/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2026-08-22T21:30:35.676Z","issues_count":52,"pull_requests_count":12,"avg_time_to_close_issue":13004205.875,"avg_time_to_close_pull_request":339647.4166666667,"issues_closed_count":48,"pull_requests_closed_count":12,"pull_request_authors_count":4,"issue_authors_count":34,"avg_comments_per_issue":3.75,"avg_comments_per_pull_request":0.8333333333333334,"merged_pull_requests_count":11,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":7,"past_year_pull_requests_count":4,"past_year_avg_time_to_close_issue":1588854.6,"past_year_avg_time_to_close_pull_request":301.0,"past_year_issues_closed_count":5,"past_year_pull_requests_closed_count":4,"past_year_pull_request_authors_count":1,"past_year_issue_authors_count":2,"past_year_avg_comments_per_issue":2.4285714285714284,"past_year_avg_comments_per_pull_request":1.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":4,"issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/issues","maintainers":[{"login":"rvalavi","count":7,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/rvalavi"},{"login":"iflint1","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/iflint1"}],"active_maintainers":[{"login":"rvalavi","count":4,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/rvalavi"}]},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/blockCV/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/blockCV/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/blockCV/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/blockCV/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/blockCV/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/blockCV/codemeta","maintainers":[{"uuid":"valavi.r@gmail.com","login":null,"name":"Roozbeh Valavi","email":"valavi.r@gmail.com","url":null,"packages_count":3,"html_url":null,"role":null,"created_at":"2022-11-14T17:18:41.300Z","updated_at":"2022-11-14T17:18:41.300Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/maintainers/valavi.r@gmail.com/packages"}],"registry":{"name":"cran.r-project.org","url":"https://cran.r-project.org","ecosystem":"cran","default":true,"packages_count":29614,"maintainers_count":16845,"namespaces_count":0,"keywords_count":9518,"github":"r-project-org","metadata":{"icon_url":"https://cran.r-project.org/CRANlogo.png","funded_packages_count":637},"icon_url":"https://cran.r-project.org/CRANlogo.png","created_at":"2022-04-06T16:32:25.637Z","updated_at":"2026-08-23T05:04:59.650Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages","maintainers_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/maintainers","namespaces_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/namespaces"}}],"commits":{"id":722472,"full_name":"rvalavi/blockCV","default_branch":"master","total_commits":352,"total_committers":4,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":88.0,"dds":0.014204545454545414,"past_year_total_commits":47,"past_year_total_committers":1,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":47.0,"past_year_dds":0.0,"last_synced_at":"2026-08-19T20:02:18.616Z","last_synced_commit":"908b4a03215855e26f70896c26c70fffe807514a","created_at":"2023-03-09T13:06:42.446Z","updated_at":"2026-08-19T20:02:18.232Z","committers":[{"name":"Roozbeh Valavi","email":"valavi.r@gmail.com","login":"rvalavi","count":347},{"name":"Ian Flint","email":"ian.flint@unimelb.edu.au","login":"iflint1","count":2},{"name":"Ian Flint","email":"iflint@2200l-154784-l.mobility.unimelb.net.au","login":null,"count":2},{"name":"MayaGueguen","email":"maya.gueguen@gmail.com","login":"MayaGueguen","count":1}],"past_year_committers":[{"name":"Roozbeh Valavi","email":"valavi.r@gmail.com","login":"rvalavi","count":47}],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-08-20T00:00:10.776Z","repositories_count":6760949,"commits_count":979925585,"contributors_count":41305604,"owners_count":1361143,"committers_count":3355573,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"rvalavi/blockCV","html_url":"https://github.com/rvalavi/blockCV","last_synced_at":"2026-08-22T21:30:35.676Z","status":null,"issues_count":52,"pull_requests_count":12,"avg_time_to_close_issue":13004205.875,"avg_time_to_close_pull_request":339647.4166666667,"issues_closed_count":48,"pull_requests_closed_count":12,"pull_request_authors_count":4,"issue_authors_count":34,"avg_comments_per_issue":3.75,"avg_comments_per_pull_request":0.8333333333333334,"merged_pull_requests_count":11,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":7,"past_year_pull_requests_count":4,"past_year_avg_time_to_close_issue":1588854.6,"past_year_avg_time_to_close_pull_request":301.0,"past_year_issues_closed_count":5,"past_year_pull_requests_closed_count":4,"past_year_pull_request_authors_count":1,"past_year_issue_authors_count":2,"past_year_avg_comments_per_issue":2.4285714285714284,"past_year_avg_comments_per_pull_request":1.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":4,"created_at":"2023-05-10T22:35:55.554Z","updated_at":"2026-08-22T21:30:35.676Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvalavi%2FblockCV/issues","issue_labels_count":{"enhancement":4,"invalid":2,"good first issue":2,"help wanted":1,"bug":1},"pull_request_labels_count":{},"issue_author_associations_count":{"NONE":52},"pull_request_author_associations_count":{"OWNER":7,"NONE":2,"COLLABORATOR":2,"CONTRIBUTOR":1},"issue_authors":{"JosiahParry":6,"pat-s":6,"AMBarbosa":5,"ozgurhsyndgn":3,"Cam-in":2,"immaryw":2,"bcknr":1,"Moncef-Boukhecheba":1,"Navvie2019":1,"rudeboybert":1,"Geethen":1,"zhangzhixin1102":1,"topepo":1,"bfakos":1,"anackr":1,"thomasp85":1,"carbonmetrics":1,"plthompson":1,"mmfink":1,"rsbivand":1,"taylorheadland":1,"HendrikHamacher":1,"amythor":1,"bpetitpi":1,"HenrikBengtsson":1,"ptitle":1,"edzer":1,"vplima":1,"Baldl":1,"cwberry77":1,"jopaulo77":1,"teunbrand":1,"rahulkgour":1,"DomHenry":1},"pull_request_authors":{"rvalavi":7,"MayaGueguen":2,"iflint1":2,"be-marc":1},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-08-23T00:00:07.901Z","repositories_count":16292221,"issues_count":42261837,"pull_requests_count":134562717,"authors_count":11512799,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{"enhancement":2},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{"NONE":7},"past_year_pull_request_author_associations_count":{"OWNER":4},"past_year_issue_authors":{"JosiahParry":6,"taylorheadland":1},"past_year_pull_request_authors":{"rvalavi":4},"maintainers":[{"login":"rvalavi","count":7,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/rvalavi"},{"login":"iflint1","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/iflint1"}],"active_maintainers":[{"login":"rvalavi","count":4,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/rvalavi"}]},"events":{"total":{"IssueCommentEvent":12,"IssuesEvent":10,"PullRequestEvent":1,"PushEvent":29,"WatchEvent":9},"last_year":{"IssuesEvent":1,"PushEvent":13,"WatchEvent":3}},"keywords":["cross-validation","r","r-package","rstats","spatial","spatial-cross-validation","spatial-modelling","species-distribution-modelling"],"dependencies":[{"ecosystem":"actions","filepath":".github/workflows/R-CMD-check.yml","sha":null,"kind":"manifest","created_at":"2023-02-18T23:01:45.852Z","updated_at":"2023-02-18T23:01:45.852Z","repository_link":"https://github.com/rvalavi/blockCV/blob/master/.github/workflows/R-CMD-check.yml","dependencies":[{"id":7772657104,"package_name":"actions/checkout","ecosystem":"actions","requirements":"v3","direct":true,"kind":"composite","optional":false},{"id":7772657123,"package_name":"r-lib/actions/setup-r","ecosystem":"actions","requirements":"v2","direct":true,"kind":"composite","optional":false},{"id":7772657126,"package_name":"r-lib/actions/setup-pandoc","ecosystem":"actions","requirements":"v2","direct":true,"kind":"composite","optional":false},{"id":7772657127,"package_name":"r-lib/actions/setup-tinytex","ecosystem":"actions","requirements":"v2","direct":true,"kind":"composite","optional":false}]},{"ecosystem":"cran","filepath":"DESCRIPTION","sha":null,"kind":"manifest","created_at":"2022-08-07T16:15:19.067Z","updated_at":"2022-08-07T16:15:19.067Z","repository_link":"https://github.com/rvalavi/blockCV/blob/master/DESCRIPTION","dependencies":[{"id":602309676,"package_name":"R","ecosystem":"cran","requirements":"\u003e= 3.5.0","direct":true,"kind":"depends","optional":false},{"id":602309681,"package_name":"raster","ecosystem":"cran","requirements":"\u003e= 2.5","direct":true,"kind":"imports","optional":false},{"id":602309683,"package_name":"sf","ecosystem":"cran","requirements":"\u003e= 0.8","direct":true,"kind":"imports","optional":false},{"id":602309685,"package_name":"progress","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":602309687,"package_name":"knitr","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309689,"package_name":"ggplot2","ecosystem":"cran","requirements":"\u003e= 3.2.1","direct":true,"kind":"suggests","optional":false},{"id":602309691,"package_name":"cowplot","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309693,"package_name":"automap","ecosystem":"cran","requirements":"\u003e= 1.0","direct":true,"kind":"suggests","optional":false},{"id":602309694,"package_name":"rgeos","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309696,"package_name":"rgdal","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309698,"package_name":"future","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309701,"package_name":"future.apply","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309703,"package_name":"shiny","ecosystem":"cran","requirements":"\u003e= 1.0.3","direct":true,"kind":"suggests","optional":false},{"id":602309705,"package_name":"shinydashboard","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309707,"package_name":"geosphere","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309710,"package_name":"methods","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309712,"package_name":"rmarkdown","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309715,"package_name":"testthat","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false},{"id":602309717,"package_name":"covr","ecosystem":"cran","requirements":"*","direct":true,"kind":"suggests","optional":false}]}],"score":14.593834934431687,"created_at":"2026-05-10T07:19:31.237Z","updated_at":"2026-08-23T22:03:21.390Z","avatar_url":"https://github.com/rvalavi.png","language":"R","category":"Biosphere","sub_category":"Species Distribution Modeling","monthly_downloads":4005,"total_dependent_repos":10,"total_dependent_packages":8,"readme":"# blockCV \u003cimg src=\"man/figures/logo.png\" align=\"right\" width=\"120\"/\u003e\n\n[![R build\nstatus](https://github.com/rvalavi/blockCV/workflows/R-CMD-check/badge.svg)](https://github.com/rvalavi/blockCV/actions)\n[![codecov](https://codecov.io/gh/rvalavi/blockCV/branch/master/graph/badge.svg)](https://codecov.io/gh/rvalavi/blockCV)\n[![GitHub](https://img.shields.io/github/r-package/v/rvalavi/blockCV/master?label=GitHub)](https://github.com/rvalavi/blockCV)\n[![CRAN](https://img.shields.io/cran/v/blockCV?label=CRAN\u0026color=brightgreen)](https://CRAN.R-project.org/package=blockCV)\n[![total](https://cranlogs.r-pkg.org/badges/grand-total/blockCV)](https://CRAN.R-project.org/package=blockCV)\n[![License](https://img.shields.io/badge/license-GPL%20(%3E=%203)-lightgrey.svg?style=flat)](http://www.gnu.org/licenses/gpl-3.0.html)\n[![MEE](https://img.shields.io/badge/Methods%20in%20Ecology%20%26%20Evolution-10,%20225--232-blue.svg)](https://doi.org/10.1111/2041-210X.13107)\n\n### Spatially and environmentally separated folds for cross-validation\n\nThe `blockCV` package creates spatially or environmentally separated\ntraining and testing folds for **k-fold**, **leave-group-out**, and\n**leave-one-out (LOO)** cross-validation. These folds support more\nrealistic evaluation of models fitted to spatially structured data,\nincluding remote-sensing classification, soil mapping, and species\ndistribution modelling.\n\nAlongside several fold-construction strategies, `blockCV` provides tools\nfor checking fold balance, comparing fold separation with the prediction\ndomain, and identifying environmental extrapolation. It can also estimate\nspatial autocorrelation ranges in point data or continuous raster\ncovariates, providing an initial distance scale to investigate when\ndesigning spatial folds.\n \n## Main features\n\n-   Six fold-construction strategies: spatial blocks (`cv_spatial`),\n    spatial or environmental clustering (`cv_cluster`), existing grouping\n    factors (`cv_group`), buffering (`cv_buffer`), leave-one-out nearest\n    neighbour distance matching (`cv_nndm`), and k-fold nearest neighbour\n    distance matching (`cv_knndm`)\n-   Hexagonal (default), rectangular, or user-defined spatial blocks,\n    assigned to folds using random, systematic, checkerboard, or predefined\n    selection. Random assignment can search for balanced folds\n-   Environmental clustering with optional spatial constraints through\n    `spatial_weight`, and optional over-clustering to improve fold balance\n-   Geographical or feature-space kNNDM using prediction locations supplied\n    by a raster (`r`), prediction points (`pred_points`), or a polygon\n    (`model_domain`), with block, hierarchical, or k-means grouping\n-   Response-aware fold summaries and, where supported, balancing for\n    binary, multi-class, continuous, count, and presence-background data.\n    Continuous and count responses can be grouped into quantile bins using\n    `num_bins`\n-   Fold diagnostics through `cv_summary`, `cv_distance`, and\n    `cv_similarity` to assess balance, train-test separation, agreement\n    with prediction-domain distances, and environmental extrapolation\n-   Fold visualisation with `cv_plot`, including faceted train-test maps\n    for every strategy and combined-fold maps for k-fold methods\n-   Spatial autocorrelation and interactive block-size tools\n    (`cv_spatial_autocor` and `cv_block_size`) for exploring an initial\n    separation distance\n-   Raster processing with `terra`, including support for `stars`,\n    `raster`, and raster files on disk\n\n## What's new in v4.0\n\n-   Added `cv_knndm` for k-fold nearest neighbour distance matching, with\n    geographical and feature-space matching and block, hierarchical, or\n    k-means grouping\n-   Added `cv_group` for leave-group-out cross-validation based on an\n    existing site, plot, campaign, individual, or other grouping factor\n-   Added `cv_summary` for one-call fold-quality summaries and warnings,\n    and `cv_distance` for comparing fold separation with nearest-neighbour\n    distances in the prediction domain\n-   Expanded `cv_similarity` with per-fold extrapolation summaries,\n    overall novelty rates, and spatial map visualisation\n-   Made fold balancing explicit in `cv_spatial`, `cv_cluster`, and\n    `cv_knndm`; added presence-background balancing and quantile binning\n    (`num_bins`) for continuous or count responses\n-   Added spatially-constrained environmental clustering through\n    `cv_cluster(spatial_weight = ...)`\n-   Added combined-fold maps to `cv_plot` and informative print methods\n    for fold and diagnostic objects\n-   Expanded `cv_nndm` and `cv_knndm` to accept prediction rasters,\n    prediction points, or model-domain polygons\n-   Removed the legacy v2.x function names. Other breaking changes include\n    the new structured return value from `cv_similarity`, the rename of\n    `num_plot` to `num_plots`, and interactive-only defaults for several\n    automatic plots, reports, and progress bars\n\nSee [NEWS.md](NEWS.md) for the full changelog.\n\n## Installation\n\nTo install the latest update of the package from GitHub use:\n\n``` r\nremotes::install_github(\"rvalavi/blockCV\", build_vignettes = TRUE, dependencies = TRUE)\n```\n\nOr installing from CRAN:\n\n``` r\ninstall.packages(\"blockCV\", dependencies = TRUE)\n```\n\n## Vignettes\n\nThe package ships with several tutorials as vignettes:\n\n1.  blockCV introduction: how to create block cross-validation folds (`tutorial_1`)\n2.  Choosing and diagnosing spatial folds (`tutorial_2`)\n3.  Block cross-validation for species distribution modelling (`tutorial_3`)\n4.  Using blockCV with `caret` (`tutorial_4`)\n\nTo read them, install the package with the vignettes built (see [Installation](#installation) and use `build_vignettes = TRUE`), then open them from R:\n\n``` r\n# list all tutorials\nbrowseVignettes(\"blockCV\")\n\n# or open one directly\nvignette(\"tutorial_1\", package = \"blockCV\")\n```\n\n## Basic usage\n\nThe examples below highlight a few common workflows. See the\n[vignettes](#vignettes) for more information and complete examples.\n\n``` r\n# loading the package\nlibrary(blockCV)\nlibrary(sf) # working with spatial vector data\nlibrary(terra) # working with spatial raster data\n```\n\n``` r\n# load raster data; the pipe operator |\u003e is available in R v4.1 or higher\ncovars \u003c- system.file(\"extdata/au/\", package = \"blockCV\") |\u003e\n  list.files(full.names = TRUE) |\u003e\n  terra::rast()\n\n# load species presence-absence data and convert to sf\npa_data \u003c- read.csv(system.file(\"extdata/\", \"species.csv\", package = \"blockCV\")) |\u003e\n  sf::st_as_sf(coords = c(\"x\", \"y\"), crs = 7845)\n```\n\n\n``` r\n# spatial blocking by specified range and random assignment\nsb \u003c- cv_spatial(\n    x = pa_data,          # sf object of sample points (e.g. species data)\n    column = \"occ\",       # optional response column for fold records/balancing\n    r = covars,           # a raster for background (optional)\n    size = 350000,        # size of the blocks in metres\n    k = 5,                # number of folds\n    hexagon = TRUE,       # use hexagonal blocks - default\n    selection = \"random\", # random blocks-to-fold\n    balance = TRUE,       # find balanced folds\n    iteration = 100,      # search for balanced folds\n    biomod2 = TRUE        # also create folds for biomod2\n)\n```\n![](man/figures/cv_spat.jpg)\n\nUse `cv_plot()` or the generic `plot()` method to visualise the folds.\n\n```r\nplot(sb, pa_data, combine_folds = TRUE)\n```\n![](man/figures/cv_spat_folds.jpg)\n\n`cv_similarity()` compares each testing fold with its corresponding training\ndata to identify environmental extrapolation. Negative MESS values flag test\npoints outside the environmental range represented by their training data.\nThe distribution and map views show how much extrapolation occurs and where,\nwhile the returned object also provides per-fold and overall summaries.\n\n``` r\nsim1 \u003c- cv_similarity(cv = sb, x = pa_data, r = covars, method = \"MESS\")\nsim2 \u003c- cv_similarity(cv = sb, x = pa_data, r = covars, method = \"MESS\", type = \"map\")\n\nsim_map \u003c- sim2$plot +\n    ggplot2::labs(x = \"Longitude\", y = \"Latitude\")\n\ncowplot::plot_grid(sim1$plot, sim_map, nrow = 1)\n```\n\n![](man/figures/cv_sim.jpg)\n\n`cv_cluster()` can be tailored to different validation goals. For spatial\nclustering, `balance = TRUE` forms additional candidate clusters and assigns\nthem to folds to improve record or response-class balance; `k_multiplier`\ncontrols the trade-off with geographical compactness. For environmental\nclustering, `spatial_weight` adds a soft geographical constraint so\nenvironmentally similar folds are less spatially scattered.\n\n``` r\n# balanced spatial clustering\nset.seed(6)\nbc \u003c- cv_cluster(\n    x = pa_data,\n    column = \"occ\",\n    k = 5,\n    balance = TRUE,\n    k_multiplier = 3\n)\n\n# spatially-constrained environmental clustering\nset.seed(6)\nsec \u003c- cv_cluster(\n    x = pa_data,\n    r = covars,\n    column = \"occ\",\n    k = 5,\n    spatial_weight = 0.4\n)\n```\n\n``` r\nbc_plot \u003c- cv_plot(bc, x = pa_data, combine_folds = TRUE) +\n    ggplot2::labs(title = \"Balanced spatial clustering\")\n\nsec_plot \u003c- cv_plot(sec, x = pa_data, combine_folds = TRUE) +\n    ggplot2::labs(title = \"Spatially-constrained environmental clustering\")\n\ncowplot::plot_grid(bc_plot, sec_plot, nrow = 1)\n```\n\n![](man/figures/cv_clust.jpg)\n\nCreate k-fold NNDM folds:\n\n``` r\n# k-fold nearest neighbour distance matching\nknn \u003c- cv_knndm(\n    x = pa_data,\n    column = \"occ\", # optionally prefer class-complete folds\n    r = covars, # prediction area, or use pred_points/model_domain\n    k = 5,\n    num_sample = 5000\n)\n```\n\n``` r\n# compare an existing fold design with prediction-domain distances\ncv_distance(\n    cv = sb,\n    x = pa_data,\n    r = covars,\n    num_sample = 5000\n)\n```\n\nInvestigate spatial autocorrelation in the landscape to choose a\nsuitable size for spatial blocks:\n\n``` r\n# exploring the effective range of spatial autocorrelation in raster covariates or sample data\ncv_spatial_autocor(\n    r = covars, # a SpatRaster object or path to files\n    num_sample = 5000, # number of cells to be used\n    plot = TRUE\n)\n```\n\nFor the residual-based block-size guidance in Roberts et al. (2017), fit\nthe model first, add its residuals to the sample points, and pass that\nresidual column to `cv_spatial_autocor(x = ..., column = ...)`. Ranges\nestimated from the raw response or raster covariates are exploratory\nproxies and may mis-size blocks for residual autocorrelation.\n\nAlternatively, you can manually choose the size of spatial blocks in an\ninteractive session using a Shiny app.\n\n``` r\n# a shiny interactive app to aid selecting a size for spatial blocks\ncv_block_size(\n    r = covars[[1]],\n    x = pa_data, # optionally add sample points\n    column = \"occ\",\n    min_size = 2e5,\n    max_size = 9e5\n)\n```\n\n## Reporting issues\n\nPlease report issues at: \u003chttps://github.com/rvalavi/blockCV/issues\u003e\n\n## Acknowledgements\n\nSpecial thanks to **Eleanor Stern**, who created the original artwork for\nthe `blockCV` logo.\n\n## Citation\n\nTo cite package **blockCV** in publications, please use:\n\nValavi R, Elith J, Lahoz-Monfort JJ, Guillera-Arroita G. **blockCV: An R\npackage for generating spatially or environmentally separated folds for\nk-fold cross-validation of species distribution models**. *Methods Ecol\nEvol*. 2019; 10:225--232. \u003chttps://doi.org/10.1111/2041-210X.13107\u003e\n","funding_links":[],"readme_doi_urls":["https://doi.org/10.1111/2041-210X.13107"],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":[],"project_url":"https://ost.ecosyste.ms/api/v1/projects/354349","html_url":"https://ost.ecosyste.ms/projects/354349"}