Package: xaci 1.1.0

xaci: Actuarial Climate Index

Computes the Actuarial Climate Index (ACI) and its components (temperature, precipitation, drought, wind, sea level) from gridded climate data ('NetCDF') and tide gauge records. Implements the methodology described in Garrido, Milhaud & Olympio (2025) <https://hal.science/hal-04491982v2> for a French/European actuarial climate index, building on the American Academy of Actuaries framework, to any country in the world.

Authors:Xavier Milhaud [aut, cre, ctb], Dabakh Kane [ctb], Esteban Mauboussin [ctb]

xaci_1.1.0.tar.gz
xaci_1.1.0.zip(r-4.7-any)xaci_1.1.0.zip(r-4.6-any)xaci_1.1.0.zip(r-4.5-any)
xaci_1.1.0.tgz(r-4.6-any)xaci_1.1.0.tgz(r-4.5-any)
xaci_1.1.0.tar.gz(r-4.7-any)xaci_1.1.0.tar.gz(r-4.6-any)
xaci_1.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
xaci/json (API)

# Install 'xaci' in R:
install.packages('xaci', repos = c('https://xaviermilhaud.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/xaviermilhaud/xaci/issues

On CRAN:

Conda:

5.54 score 504 downloads 59 exports 64 dependencies

Last updated from:20530c5d6b. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK461
source / vignettesOK238
linux-releaseOK454
macos-releaseOK447
macos-oldrelOK350
windows-develOK650
windows-releaseOK571
windows-oldrelOK644
wasm-releaseOK150

Exports:.spatraster_to_listaggregate_granularityanimate_aci_mapapply_maskapply_mask_terraassign_sealevel_to_adminbuild_admin_maskcalculate_acicalculate_halfday_componentcalculate_halfday_component_terracalculate_maximum_precipitation_over_windowcalculate_maximum_precipitation_over_window_terracalculate_percentilescalculate_percentiles_terracalculate_period_wind_exceedance_frequencycalculate_period_wind_exceedance_frequency_terracalculate_rolling_sumcds_set_keydays_above_wind_thresholdsdownload_era5download_era5_alldownload_maskdrought_componentdrought_component_terradrought_interpolateload_componentload_component_terraload_netcdf_terraload_psmsl_datamax_consecutive_dry_daysmax_consecutive_dry_days_terraplot_aci_componentsplot_aci_dashboardplot_aci_distributionplot_aci_mapplot_aci_map_meanplot_aci_timeseriesprecipitation_componentprecipitation_component_terrareduce_dataarray_to_dataframerequest_sealevel_dataresample_daily_terrasealevel_clean_datasealevel_componentsealevel_compute_monthly_statssealevel_correct_date_formatsealevel_load_datasealevel_processsealevel_standardize_datastandardize_metrictemp_extremumtemp_extremum_terratemperature_componenttemperature_component_terrawind_componentwind_component_terrawind_powerwind_power_terrawind_thresholds

Dependencies:askpassbitbit64classclassIntclicliprcpp11crayoncurlDBIdplyre1071farvergenericsgeodataggplot2gluegtablehmshttrisobandjsonliteKernSmoothlabelinglatticelifecyclemagrittrmimencdf4opensslpillarpkgconfigprettyunitsprogressproxypurrrR6rappdirsRColorBrewerRcppreadrrlangrnaturalearths2S7scalessfstringistringrsysterratibbletidyrtidyselecttzdbunitsutf8vctrsviridisLitevroomwithrwkzoo

Administrative-Level Aggregation
How it works | The aggregation mechanics, without the network | A synthetic two-region country | The sea-level equivalent

Last update: 2026-08-11
Started: 2026-07-22

Computing the Six ACI Components
Building a synthetic ERA5-like extract | Temperature: temperature_component() | Precipitation: precipitation_component() | Drought: drought_component() | Wind: wind_component() | Sea level: sealevel_component() | Caching heavy computations (steps 3-4)

Last update: 2026-08-11
Started: 2026-07-22

Get Started with xaci
What is the Actuarial Climate Index? | The four-step workflow | Where things get cached | A minimal worked example

Last update: 2026-08-11
Started: 2026-07-22

Memory-Safe Processing with the terra Engine
Why a second engine? | Same inputs, same outputs | Via calculate_aci() | The cores argument

Last update: 2026-08-11
Started: 2026-07-22

The Aggregation Matrix: Every Spatial x Temporal Combination
Building one small synthetic dataset | Step 1 — compute every component once | Pre-seeding the administrative cache (no network) | The three spatial modes, one temporal granularity | The four granularities, one spatial mode | The full matrix | Mapping one of the grid-cell combinations | Wrap-up

Last update: 2026-07-31
Started: 2026-07-30

Visualizing ACI Results
Preparing example results | Time series: plot_aci_timeseries() | Component breakdown: plot_aci_components() | Distributions: plot_aci_distribution() | Maps: plot_aci_map() | Dashboard: plot_aci_dashboard() | Animated maps: animate_aci_map()

Last update: 2026-07-31
Started: 2026-07-22

Running calculate_aci() End to End
Building the synthetic dataset | Running the pipeline | Reading the output | Changing granularity without recomputing | Grid-cell mode: output for mapping

Last update: 2026-07-31
Started: 2026-07-22

Readme and manuals

Help Manual

Help pageTopics
Convert a (small) SpatRaster back to the package's plain-list format.spatraster_to_list
Actuarial Climate Index (ACI)aci
Aggregate a monthly data frame to a given temporal granularityaggregate_granularity
Animate the ACI or a component over timeanimate_aci_map
Apply a country mask to a NetCDF data arrayapply_mask
Apply a country mask to a SpatRasterapply_mask_terra
Assign PSMSL tide-gauge stations to administrative units and compute coastal factorsassign_sealevel_to_admin
Build a spatial weight matrix mapping ERA5 grid cells to administrative unitsbuild_admin_mask
Calculate the Actuarial Climate Indexcalculate_aci
Calculate the half-day (day or night) temperature componentcalculate_halfday_component
Calculate the half-day (day or night) temperature component (terra version)calculate_halfday_component_terra
Calculate maximum precipitation over a rolling windowcalculate_maximum_precipitation_over_window
Calculate maximum precipitation over a rolling window (terra version)calculate_maximum_precipitation_over_window_terra
Compute temperature percentile thresholds for each day of yearcalculate_percentiles
Compute temperature percentile thresholds for each day of year (terra version)calculate_percentiles_terra
Calculate monthly wind exceedance frequencycalculate_period_wind_exceedance_frequency
Calculate monthly wind exceedance frequency (terra version)calculate_period_wind_exceedance_frequency_terra
Calculate the rolling sum of a climate variablecalculate_rolling_sum
Set your CDS Personal Access Tokencds_set_key
Base Climate Component Helperscomponent
Terra-based Loading and Hourly-to-Daily Reductioncomponent_terra
Calculate days with wind power above the 90th-percentile thresholddays_above_wind_thresholds
Download ERA5 and Country Mask Datadownload
Download an ERA5 variable from the Copernicus CDSdownload_era5
Download all ERA5 variables required by the xaci packagedownload_era5_all
Download the country mask from the Copernicus CDSdownload_mask
Drought Component of the ACIdrought
Calculate the drought component of the ACIdrought_component
Calculate the drought component of the ACI (terra version)drought_component_terra
Linearly interpolate annual CDD to monthly resolutiondrought_interpolate
Terra-based Drought Componentdrought_terra
Load a NetCDF dataset and optionally apply a country maskload_component
Load a NetCDF variable and optionally apply a country mask (terra version)load_component_terra
Lazily load a NetCDF variable as a terra SpatRasterload_netcdf_terra
Load the bundled PSMSL station metadataload_psmsl_data
Calculate maximum consecutive dry days (CDD) per yearmax_consecutive_dry_days
Calculate maximum consecutive dry days (terra version)max_consecutive_dry_days_terra
Plot the ACI component decompositionplot_aci_components
Plot a summary dashboard of the ACI resultsplot_aci_dashboard
Plot the distribution of ACI componentsplot_aci_distribution
Plot a spatial map of the ACI or one of its componentsplot_aci_map
Plot the temporal mean of an ACI variable over a sub-periodplot_aci_map_mean
Plot the ACI global time seriesplot_aci_timeseries
Precipitation Component of the ACIprecipitation
Calculate the precipitation component of the ACIprecipitation_component
Calculate the precipitation component of the ACI (terra version)precipitation_component_terra
Terra-based Precipitation Componentprecipitation_terra
Reduce a standardised spatial metric to a data framereduce_dataarray_to_dataframe
Download PSMSL tide-gauge data for a countryrequest_sealevel_data
Resample a SpatRaster to daily resolution (terra version)resample_daily_terra
Sea Level Component of the ACIsealevel
Replace PSMSL sentinel values (-99999) with NAsealevel_clean_data
Calculate the sea-level component of the ACIsealevel_component
Compute monthly reference statistics for sea-level datasealevel_compute_monthly_stats
Correct PSMSL float date format to Date objectssealevel_correct_date_format
Load sea-level txt files from a directorysealevel_load_data
Full sea-level processing pipelinesealevel_process
Standardise sea-level data over the study periodsealevel_standardize_data
Standardise a monthly metric relative to a reference periodstandardize_metric
Compute daily temperature extremum (min or max) for day or night hourstemp_extremum
Compute daily temperature extremum (min or max) for day or night hours (terra version)temp_extremum_terra
Temperature Component of the ACItemperature
Calculate the full temperature component of the ACItemperature_component
Compute the temperature ACI component (terra version)temperature_component_terra
Terra-based Temperature Componenttemperature_terra
Utility Functions for ACI Packageutils
Visualization Functions for the ACI Packagevisualization
Wind Component of the ACIwind
Calculate the wind component of the ACIwind_component
Calculate the wind component of the ACI (terra version)wind_component_terra
Calculate daily wind power from u10 and v10 componentswind_power
Calculate daily wind power from u10 and v10 components (terra version)wind_power_terra
Terra-based Wind Componentwind_terra
Calculate wind power thresholds (90th percentile per day-of-year)wind_thresholds