Parse Stan array parameter
parse_stan_posterior_array.RdParse Stan array parameter where each columns is in form <varname>[index1, index2, ...]>. Extracts the variable, pivots table into long format so that each index is a separate column. Name of each column and factor levels are defined via columns` parameter.
Arguments
- draws
cmdstanr draws in "df" format
- varname
Name of the variable in draws
- columns
List of columns that correspond to array indexes. Each columns is described via
<name> = <vector of factor levels>. Each index is converted to a factor column with labelled factor levels. If<vector of factor levels>isNULL, column contains original integer indexes.- value_name
Name of the value column, defaults to "Value"