era5ify_geojson: PascalCase Aliases

View source: R/core.R

varunayan-aliasesR Documentation

PascalCase Aliases

Description

PascalCase aliases for all exported functions. The aliases keep backward compatibility.

Usage

ERA5ifyGeojson(...)

era5ify_geojson(
  request_id,
  variables,
  start_date,
  end_date,
  json_file,
  dataset_type = "single",
  pressure_levels = NULL,
  frequency = "hourly",
  resolution = 0.25,
  save_raw = FALSE,
  output_dir = tempdir(),
  use_cache = TRUE,
  convert_units = TRUE,
  verbose = FALSE,
  level = c("union", "feature")
)

Arguments

...

Arguments passed to the main function (used by aliases).

request_id

Unique identifier for the data request

variables

List of ERA5 variables to download

start_date

Start date in "YYYY-MM-DD" format

end_date

End date in "YYYY-MM-DD" format

json_file

Path to the GeoJSON file that defines the region

dataset_type

Type of dataset ("single" or "pressure")

pressure_levels

Pressure levels for pressure dataset

frequency

Temporal frequency ("hourly", "daily", "monthly")

resolution

Spatial resolution in degrees (default: 0.25)

save_raw

If TRUE, save the raw downloaded files

output_dir

Directory for the saved files (default: tempdir())

use_cache

If TRUE, use cached data when it is available (default: TRUE)

convert_units

If TRUE, convert units to user-friendly formats (default: TRUE). When TRUE, the function returns temperature variables in Celsius (converted from Kelvin). It returns precipitation variables in mm (converted from meters).

verbose

If TRUE, print detailed progress messages

level

"union" (default) returns one row for each grid cell inside the union of all the features. "feature" returns one row for each feature (for example, each district), with the mean of the cells inside it. Such rows have a feature_id column (the row number of the feature) and the feature properties in place of latitude and longitude. A feature smaller than a grid cell gets the nearest cell.

Value

data.frame with processed climate data. When convert_units = TRUE:

  • Temperature variables (e.g., 2m_temperature): Celsius

  • Precipitation variables (e.g., total_precipitation): mm

  • Other variables: original ERA5 units

Examples


region <- system.file("extdata", "region.geojson", package = "varunayan")
setup_cds_credentials(key = "your-cds-api-key")

data <- era5ify_geojson(
  request_id = "my_request",
  variables = c("2m_temperature", "total_precipitation"),
  start_date = "2023-01-01",
  end_date = "2023-01-31",
  json_file = region
)
# Temperature is in Celsius. Precipitation is in mm.


varunayan documentation built on Oct. 30, 2026, 1:07 a.m.