Learn R Programming

climatehealth (version 1.0.0)

extract_means_for_geography: Extract mean wildfire PM2.5 values for shapefile regions from NetCDF file

Description

Takes a NetCDF file of gridded wildfire data and shapefile for geographical regions and extracts mean values for each shapefile region.

Information on NetCDF files: https://climatedataguide.ucar.edu/climate-tools/NetCDF#:~:text=An%20nc4%20files%20is%20a,readily%20handle%20netCDF%2D4%20files.

We use a daily time series of gridded wildfire-related PM2.5 concentration from the Finnish Meteorological Institute's SILAM-CTM model. This is available open-source: https://doi.org/10.57707/fmi-b2share.d1cac971b3224d438d5304e945e9f16c.

Usage

extract_means_for_geography(
  ncdf_path,
  shp_path,
  region_col = "region",
  output_value_col = "mean_PM"
)

Value

Dataframe containing a daily time series with mean wildfire-related PM2.5 values for each region

Arguments

ncdf_path

Path to a NetCDF file

shp_path

Path to a shapefile .shp of the geographical boundaries for which to extract mean values of wildfire-related PM2.5

region_col

Character. The name of the column containing region data in the shapefile. Defaults to 'region'

output_value_col

Character. The name of the value column to include in the output. Defaults to mean_PM