Skip to contents

InferenceData column names for scalar variables are of the form "('group', 'var_name')", while column names for array variables are of the form "('group', 'var_name[i,j]', 'i_name', 'j_name')". This function converts these column names to a format that is useful for creating tidy_draws data frames. "('group', 'var_name')" becomes "group|var_name" "('group', 'var_name[i,j]', 'i_name', 'j_name')" becomes "group|var_name[i_name, j_name]"

Usage

idata_names_to_tidy_names(column_names)

Arguments

column_names

A character vector of InferenceData column names

Value

A character vector of tidy column names

Examples

forecasttools:::idata_names_to_tidy_names(c(
  "('group', 'var_name')",
  "group|var_name[i_name, j_name]"
))
#> [1] "group|var_name"                "group|var_name[i_name|j_name]"