4  Data Download

LogoClim integrates WorldClim data into NetLogo models through a multi-step conversion process that can introduce minor discrepancies between the original data and the values used in the model. We recommend verifying data accuracy by running the Near-Equality Tests notebook before proceeding with your analysis.

To make downloading WorldClim data easier, we developed the worldclim_download() function as part of the orbis R package (Vartanian, 2026). It takes care of accessing the WorldClim website, fetching the data, and organizing everything the way LogoClim needs it. Here is an overview of its main parameters:

worldclim_download(
  series,
  resolution = NULL,
  variable = NULL,
  model = NULL,
  ssp = NULL,
  year = NULL
)

You can install the orbis package in R using the remotes package. If you don’t have remotes installed, you can install it with:

install.packages("remotes")

After that, install orbis directly from GitHub with:

install_github("danielvartan/orbis")

4.1 Data Selection

The first thing you need to do is explore the WorldClim website to select the appropriate data for your needs. With this information, you simply specify the parameters for the worldclim_download() function.

For example, to download total precipitation data from the [Historical Monthly Weather Data(https://www.worldclim.org/data/monthlywth.html) series, between the years 2020 and 2024, at the 10-minute resolution, you could use the following code:

files <- worldclim_download(
  series = "hmwd",
  resolution = "10m",
  variable = "prec",
  year = "2020-2024",
  dir = "path/to/your/data/directory"
)
#> ✔ Scraping WorldClim Website [569ms]
#> ℹ Total download size (compressed): 104M.
#> ✔ Calculating File Sizes [698ms]
#> ✔ Creating LICENSE and README Files [12ms]
#> ℹ Downloading 1 file to path/to/your/data/directory/historical-monthly-weather-data
#> ✔ Downloading Files [10.3s]                          
#> ✔ Unzipping Files [11ms]

Keep in mind that depending on your settings, the data can take up quite a bit of storage space. Make sure you have enough room before downloading.

4.2 File Structure

worldclim_download() downloads and organizes files into a structure required by LogoClim. The organization follows this hierarchy:

data
├── historical-climate-data
├── historical-monthly-weather-data
├── future-climate-data

The structure above assumes that the data will be stored in a directory named data, but you can store it in any other directory as well. You just need to configure the data path in the model settings accordingly.

The data files inside the folders also follows naming patterns that must be respected. Each series has its own naming convention:

  • Historical Climate Data:
    wc2.1  _  10m  _  tmin  _  1970-2000  -  01  .asc
    _____     ___     _____    _________    ____
      |        |        |          |          |
   Prefix  Resolution  Variable  Period     Month
  • Historical Monthly Weather Data:
    wc2.1  _  cruts4.09  _  10m  _  prec  _  1951  -  01  .asc
    ______    __________    ____    _____    _____    ___
      |            |         |          |        |     |
   Prefix   CRU-TS Version  Resolution  Variable Year  Month
  • Future climate data:
    wc2.1  _  10m  _  bioc  _  ACCESS-CM2  _  ssp126  _  2021-2040  _  01.  asc
    ______    ____    _____    __________     ______     ________      ___
      |       |        |           |            |           |           |
   Prefix  Resolution  Variable  Model         SSP        Period      Month

This naming pattern closely resembles the one used by WorldClim, but there are slight differences that must be accounted for to ensure compatibility with LogoClim.

Note the separators. They can change from _ to - depending on the data series and its specific requirements.

4.3 Conversion

After downloading the data, one final step remains before the files are ready for use in the model: converting them from GeoTIFF format to Esri ASCII format. This conversion is handled by the worldclim_to_ascii() function, which is covered in the next section.

For more details on available parameters and downloading different datasets, refer to the worldclim_download() documentation.