Skip to contents

Takes an EFI long format dataset (containing scenario, datetime/time, site_id/site, parameter/ensemble/member, variable, prediction/value) and reshapes it into a matrix of predictions with rows corresponding to timesteps and columns corresponding to ensemble members.

Usage

efi_long_to_array(df, var = NULL, site = NULL)

Arguments

df

data.frame in EFI long format.

var

character string specifying the target variable to filter (optional).

site

character string specifying the target site_id to filter (optional).

Value

A matrix with timesteps as rows and ensemble members as columns, with a `time` attribute (POSIXct vector).