{
  "_id": "6a5e26369baadeef8ab56e36",
  "Package": "blockCV",
  "Type": "Package",
  "Title": "Spatial and Environmental Blocking for Cross-Validation",
  "Version": "4.0-0",
  "Date": "2026-07-20",
  "Authors@R": "c(person(\"Roozbeh\", \"Valavi\", role = c(\"aut\", \"cre\"),\nemail = \"valavi.r@gmail.com\", comment = c(ORCID = \"0000-0003-2495-5277\")),\nperson(\"Jane\", \"Elith\", role = \"aut\",\nemail = \"j.elith@unimelb.edu.au\"),\nperson(\"José\", \"Lahoz-Monfort\", role = \"aut\",\nemail = \"jose.lahoz@unimelb.edu.au\"),\nperson(\"Ian\", \"Flint\", role = \"aut\",\nemail = \"ian.flint@unimelb.edu.au\"),\nperson(\"Gurutzeta\", \"Guillera-Arroita\", role = \"aut\",\nemail = \"gurutzeta.guillera@unimelb.edu.au\"))",
  "URL": "https://github.com/rvalavi/blockCV",
  "BugReports": "https://github.com/rvalavi/blockCV/issues",
  "Maintainer": "Roozbeh Valavi <valavi.r@gmail.com>",
  "Description": "Creates spatially or environmentally separated, or\ngroup-preserving, training and testing folds for k-fold,\nleave-group-out, and leave-one-out cross-validation. Provides\nspatial blocking, clustering, buffering, and nearest-neighbour\ndistance-matching methods, together with tools to visualise\nfolds, summarise fold sizes and class balance, and assess\ntrain–test separation and environmental novelty. Also estimates\nspatial autocorrelation ranges in point samples and continuous\nraster covariates to provide an initial distance scale for\ndesigning spatial folds. Methods are described in Valavi, R. et\nal. (2019) <doi:10.1111/2041-210X.13107>.",
  "License": "GPL (>= 3)",
  "Encoding": "UTF-8",
  "VignetteBuilder": "knitr",
  "Config/testthat/edition": "3",
  "Config/roxygen2/version": "8.0.0",
  "Config/pak/sysreqs": "libabsl-dev cmake libgdal-dev gdal-bin libgeos-dev\nlibssl-dev libproj-dev libsqlite3-dev libudunits2-dev",
  "Repository": "https://rvalavi.r-universe.dev",
  "Date/Publication": "2026-07-20 11:46:31 UTC",
  "RemoteUrl": "https://github.com/rvalavi/blockcv",
  "RemoteRef": "HEAD",
  "RemoteSha": "17d91e3c279d43cf8466aa97662ad17692136b7e",
  "NeedsCompilation": "yes",
  "Packaged": {
    "Date": "2026-07-20 13:38:31 UTC",
    "User": "root"
  },
  "Author": "Roozbeh Valavi [aut, cre] (ORCID:\n<https://orcid.org/0000-0003-2495-5277>),\nJane Elith [aut],\nJosé Lahoz-Monfort [aut],\nIan Flint [aut],\nGurutzeta Guillera-Arroita [aut]",
  "_user": "rvalavi",
  "_type": "src",
  "_file": "blockCV_4.0-0.tar.gz",
  "_fileid": "https://r2.ropensci.org/5b9b55c82efa170db4f01f3c5ae7034a4ef9abfa31fa785a91bdd7b50e4d1278",
  "_filesize": 6855507,
  "_sha256": "5b9b55c82efa170db4f01f3c5ae7034a4ef9abfa31fa785a91bdd7b50e4d1278",
  "_expires": "2026-10-28T13:44:19.000Z",
  "_created": "2026-07-20T13:38:31.000Z",
  "_published": "2026-07-20T13:44:21.878Z",
  "_jobs": [
    {
      "job": 88367916491,
      "time": 206,
      "config": "linux-devel-arm64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "8462993362"
    },
    {
      "job": 88367916462,
      "time": 219,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "8462997541"
    },
    {
      "job": 88367916553,
      "time": 203,
      "config": "linux-release-arm64",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8462991632"
    },
    {
      "job": 88367916525,
      "time": 213,
      "config": "linux-release-x86_64",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8462994268"
    },
    {
      "job": 88367916518,
      "time": 222,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "8462998639"
    },
    {
      "job": 88367916508,
      "time": 240,
      "config": "macos-oldrel-x86_64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "8463007726"
    },
    {
      "job": 88367916517,
      "time": 137,
      "config": "macos-release-arm64",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8462956960"
    },
    {
      "job": 88367916504,
      "time": 289,
      "config": "macos-release-x86_64",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8463032138"
    },
    {
      "job": 88366733074,
      "time": 284,
      "config": "source",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8462885338"
    },
    {
      "job": 88367916431,
      "time": 161,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "8462967670"
    },
    {
      "job": 88367916479,
      "time": 177,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "8462976538"
    },
    {
      "job": 88367916460,
      "time": 224,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "8463005014"
    },
    {
      "job": 88367916453,
      "time": 175,
      "config": "windows-release",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "8462975871"
    }
  ],
  "_host": "GitHub-Actions",
  "_buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629",
  "_status": "success",
  "_upstream": "https://github.com/rvalavi/blockcv",
  "_commit": {
    "id": "17d91e3c279d43cf8466aa97662ad17692136b7e",
    "author": "Roozbeh Valavi <valavi.r@gmail.com>",
    "committer": "GitHub <noreply@github.com>",
    "message": "Merge pull request #66 from rvalavi/v4-refinements\n\nupdate desc..",
    "time": 1784547991
  },
  "_maintainer": {
    "name": "Roozbeh Valavi",
    "email": "valavi.r@gmail.com",
    "login": "rvalavi",
    "bluesky": "@rvalavi.bsky.social",
    "twitter": "@ValaviRoozbeh",
    "description": "Data science and spatial ecology",
    "uuid": 30306220,
    "orcid": "0000-0003-2495-5277"
  },
  "_distro": "resolute",
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.6.0",
      "role": "Depends"
    },
    {
      "package": "Rcpp",
      "role": "LinkingTo"
    },
    {
      "package": "sf",
      "version": ">= 1.0",
      "role": "Imports"
    },
    {
      "package": "terra",
      "version": ">= 1.6-41",
      "role": "Imports"
    },
    {
      "package": "ggplot2",
      "version": ">= 3.3.6",
      "role": "Imports"
    },
    {
      "package": "cowplot",
      "role": "Imports"
    },
    {
      "package": "automap",
      "version": ">= 1.1-20",
      "role": "Imports"
    },
    {
      "package": "Rcpp",
      "version": ">= 1.0.2",
      "role": "Imports"
    },
    {
      "package": "shiny",
      "version": ">= 1.7",
      "role": "Suggests"
    },
    {
      "package": "tmap",
      "version": ">= 2.0",
      "role": "Suggests"
    },
    {
      "package": "biomod2",
      "role": "Suggests"
    },
    {
      "package": "gstat",
      "role": "Suggests"
    },
    {
      "package": "methods",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    }
  ],
  "_owner": "rvalavi",
  "_selfowned": true,
  "_usedby": 4,
  "_updates": [
    {
      "week": "2025-31",
      "n": 3
    },
    {
      "week": "2025-33",
      "n": 10
    },
    {
      "week": "2025-34",
      "n": 4
    },
    {
      "week": "2025-35",
      "n": 1
    },
    {
      "week": "2025-37",
      "n": 2
    },
    {
      "week": "2026-28",
      "n": 13
    },
    {
      "week": "2026-30",
      "n": 2
    }
  ],
  "_tags": [],
  "_topics": [
    "cross-validation",
    "spatial",
    "spatial-cross-validation",
    "spatial-modelling",
    "species-distribution-modelling",
    "cpp"
  ],
  "_stars": 123,
  "_contributors": [
    {
      "user": "rvalavi",
      "count": 358,
      "uuid": 30306220
    },
    {
      "user": "iflint1",
      "count": 2,
      "uuid": 58583428
    },
    {
      "user": "mayagueguen",
      "count": 1,
      "uuid": 16795576
    }
  ],
  "_userbio": {
    "uuid": 30306220,
    "type": "user",
    "name": "Roozbeh Valavi",
    "followers": 82,
    "description": "Data science and spatial ecology"
  },
  "_downloads": {
    "count": 3141,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/blockCV"
  },
  "_mentions": 5,
  "_devurl": "https://github.com/rvalavi/blockcv",
  "_searchresults": 520,
  "_rbuild": "4.6.1",
  "_assets": [
    "extra/blockCV.html",
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/rvalavi/blockcv",
  "_realowner": "rvalavi",
  "_cranurl": true,
  "_releases": [
    {
      "version": "2.1.1",
      "date": "2020-02-23"
    },
    {
      "version": "2.1.4",
      "date": "2021-06-17"
    },
    {
      "version": "3.0-0",
      "date": "2023-02-06"
    },
    {
      "version": "3.1-1",
      "date": "2023-04-08"
    },
    {
      "version": "3.1-2",
      "date": "2023-05-20"
    },
    {
      "version": "3.1-3",
      "date": "2023-06-04"
    },
    {
      "version": "3.1-4",
      "date": "2024-05-23"
    },
    {
      "version": "3.1-5",
      "date": "2024-11-01"
    },
    {
      "version": "3.1-6",
      "date": "2025-06-23"
    },
    {
      "version": "3.2-0",
      "date": "2025-08-21"
    }
  ],
  "_exports": [
    "cv_block_size",
    "cv_buffer",
    "cv_cluster",
    "cv_distance",
    "cv_group",
    "cv_knndm",
    "cv_nndm",
    "cv_plot",
    "cv_similarity",
    "cv_spatial",
    "cv_spatial_autocor",
    "cv_summary"
  ],
  "_help": [
    {
      "page": "blockCV",
      "title": "blockCV: Spatial, Environmental, and Grouped Cross-Validation",
      "topics": [
        "blockCV-package",
        "blockCV"
      ]
    },
    {
      "page": "cv_block_size",
      "title": "Explore spatial block size",
      "topics": [
        "cv_block_size"
      ]
    },
    {
      "page": "cv_buffer",
      "title": "Use buffer around records to separate train and test folds (a.k.a. buffered/spatial leave-one-out)",
      "topics": [
        "cv_buffer"
      ]
    },
    {
      "page": "cv_cluster",
      "title": "Use environmental or spatial clustering to separate train and test folds",
      "topics": [
        "cv_cluster"
      ]
    },
    {
      "page": "cv_distance",
      "title": "Compare a cross-validation design to the prediction domain via nearest-neighbour distances",
      "topics": [
        "cv_distance"
      ]
    },
    {
      "page": "cv_group",
      "title": "Leave-group-out cross-validation using an existing grouping factor",
      "topics": [
        "cv_group"
      ]
    },
    {
      "page": "cv_knndm",
      "title": "Use the k-fold Nearest Neighbour Distance Matching (kNNDM) to separate train and test folds",
      "topics": [
        "cv_knndm"
      ]
    },
    {
      "page": "cv_nndm",
      "title": "Use the Nearest Neighbour Distance Matching (NNDM) to separate train and test folds",
      "topics": [
        "cv_nndm"
      ]
    },
    {
      "page": "cv_plot",
      "title": "Visualising folds created by blockCV in ggplot",
      "topics": [
        "cv_plot"
      ]
    },
    {
      "page": "cv_similarity",
      "title": "Compute similarity measures to evaluate possible extrapolation in testing folds",
      "topics": [
        "cv_similarity"
      ]
    },
    {
      "page": "cv_spatial",
      "title": "Use spatial blocks to separate train and test folds",
      "topics": [
        "cv_spatial"
      ]
    },
    {
      "page": "cv_spatial_autocor",
      "title": "Measure spatial autocorrelation in spatial response data or predictor raster files",
      "topics": [
        "cv_spatial_autocor"
      ]
    },
    {
      "page": "cv_summary",
      "title": "Summarise the quality of a set of cross-validation folds",
      "topics": [
        "cv_summary"
      ]
    }
  ],
  "_pkglogo": "https://github.com/rvalavi/blockcv/raw/HEAD/man/figures/logo.png",
  "_readme": "https://github.com/rvalavi/blockcv/raw/HEAD/README.md",
  "_rundeps": [
    "abind",
    "automap",
    "class",
    "classInt",
    "cli",
    "cowplot",
    "cpp11",
    "DBI",
    "e1071",
    "farver",
    "FNN",
    "ggplot2",
    "glue",
    "gstat",
    "gtable",
    "intervals",
    "isoband",
    "KernSmooth",
    "labeling",
    "lattice",
    "lifecycle",
    "MASS",
    "plyr",
    "proxy",
    "R6",
    "RColorBrewer",
    "Rcpp",
    "reshape",
    "rlang",
    "s2",
    "S7",
    "scales",
    "sf",
    "sftime",
    "sp",
    "spacetime",
    "stars",
    "terra",
    "units",
    "vctrs",
    "viridisLite",
    "withr",
    "wk",
    "xts",
    "zoo"
  ],
  "_sysdeps": [
    {
      "shlib": "libstdc++",
      "package": "libstdc++6",
      "source": "gcc",
      "version": "16-20260322-1ubuntu1",
      "name": "c++",
      "homepage": "http://gcc.gnu.org/",
      "description": "GNU Standard C++ Library v3"
    }
  ],
  "_vignettes": [
    {
      "source": "tutorial_1.Rmd",
      "filename": "tutorial_1.html",
      "title": "blockCV introduction: how to create block cross-validation folds ",
      "author": "Roozbeh Valavi",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Introduction",
        "Installation",
        "Package data",
        "Block cross-validation strategies",
        "Spatial blocks",
        "Spatial and environmental clustering",
        "Leave-group-out cross-validation",
        "Buffering LOO (also known as Spatial LOO)",
        "Nearest Neighbour Distance Matching (NNDM) LOO",
        "k-fold Nearest Neighbour Distance Matching (kNNDM)",
        "Visualising the folds",
        "Next steps",
        "References:"
      ],
      "created": "2023-01-29 02:57:28",
      "modified": "2026-07-10 07:19:44",
      "commits": 17
    },
    {
      "source": "tutorial_2.Rmd",
      "filename": "tutorial_2.html",
      "title": "Choosing and diagnosing spatial folds ",
      "author": "Roozbeh Valavi",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Introduction",
        "Prepare data and folds",
        "Fold-quality summary",
        "Environmental similarity diagnostics",
        "Nearest-neighbour distance diagnostics",
        "Choosing a candidate block size",
        "References:"
      ],
      "created": "2023-01-29 02:57:28",
      "modified": "2026-07-09 01:42:51",
      "commits": 15
    },
    {
      "source": "tutorial_3.Rmd",
      "filename": "tutorial_3.html",
      "title": "Block cross-validation for species distribution modelling ",
      "author": "Roozbeh Valavi, Jane Elith, José Lahoz-Monfort and Gurutzeta Guillera-Arroita",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Introduction",
        "Reading and plotting data",
        "Generating block CV folds",
        "Evaluating SDMs with block cross-validation: examples",
        "Using blockCV with Random Forest model",
        "Using blockCV in biomod2 package",
        "References:"
      ],
      "created": "2026-07-09 01:42:51",
      "modified": "2026-07-09 01:42:51",
      "commits": 1
    },
    {
      "source": "tutorial_4.Rmd",
      "filename": "tutorial_4.html",
      "title": "Using blockCV with caret ",
      "author": "Roozbeh Valavi",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Introduction",
        "Prepare the data",
        "Create spatial folds",
        "Fit a caret model",
        "References"
      ],
      "created": "2026-07-09 01:42:51",
      "modified": "2026-07-09 01:42:51",
      "commits": 1
    }
  ],
  "_score": 11.528285673198566,
  "_indexed": true,
  "_nocasepkg": "blockcv",
  "_universes": [
    "rvalavi"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "4.0-0",
      "date": "2026-07-20T13:41:36.000Z",
      "distro": "resolute",
      "arch": "aarch64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/37d0fb574277b8ca54c965c2178dd03a138c29250f1d33f96c08bf2ac813f5ce",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "4.0-0",
      "date": "2026-07-20T13:41:33.000Z",
      "distro": "resolute",
      "arch": "x86_64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/e5ca260f2ca58b47b02a4a50997747e9d6ad617dbb7f3fdf488c2942450d7852",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "4.0-0",
      "date": "2026-07-20T13:41:35.000Z",
      "distro": "resolute",
      "arch": "aarch64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/cff8746705f8d5be6ec992bc4b2dfcd3fb50e0ed865add2f425bc454dca6ff76",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "4.0-0",
      "date": "2026-07-20T13:41:27.000Z",
      "distro": "resolute",
      "arch": "x86_64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/bc10311428a0c266176b9fbaf30803409a5e5ee8dad51bbb06895d224743365a",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "4.0-0",
      "date": "2026-07-20T13:41:05.000Z",
      "arch": "aarch64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/5da068a22b8c989c458ff7164d1d33a6a24f5aae3997f2c4a668c84c8094a699",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "4.0-0",
      "date": "2026-07-20T13:41:27.000Z",
      "arch": "x86_64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/7e8f1d63b2f10d380671297182354c709bd5127a72f33e70bba70a5ff970cf1b",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "4.0-0",
      "date": "2026-07-20T13:40:21.000Z",
      "arch": "aarch64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/b6eec016ab04b7182ae499d6fddef7c31ae526ed61d99ddf86176417c3cb3cd3",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "4.0-0",
      "date": "2026-07-20T13:41:57.000Z",
      "arch": "x86_64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/8f50c379f9831546b83e31642bc599bbed2b4cc4d6ab46493ee5620a06ee1b1c",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "4.0-0",
      "date": "2026-07-20T13:41:30.000Z",
      "arch": "emscripten",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/49ad572afbf531a59b55dd67a6f9771d138bb92dc1f7614d61bc62b7546d57ff",
      "status": "success",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "4.0-0",
      "date": "2026-07-20T13:40:09.000Z",
      "arch": "x86_64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/63a7b0495febfd9a4dc9bd0705fbbbeeb91d4277147f8e3220d0554edc0ed02e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "4.0-0",
      "date": "2026-07-20T13:41:07.000Z",
      "arch": "x86_64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/223d7f9b50270b92d66d004abbb92006d43575de36961b97e9ac6f1b37a686f0",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    },
    {
      "r": "4.6.1",
      "os": "win",
      "version": "4.0-0",
      "date": "2026-07-20T13:40:13.000Z",
      "arch": "x86_64",
      "commit": "17d91e3c279d43cf8466aa97662ad17692136b7e",
      "fileid": "https://r2.ropensci.org/14555fff159c7895cc71b200179c7f67f0d1ae8b99ba38d509c2ebd1b365b2fa",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/rvalavi/actions/runs/29746786629"
    }
  ]
}