Converts a data frame to the output structure of extract

df_to_stanarray(df)

Arguments

df

data frame with the column names 'parameters', 'iterations' and 'chains'

Value

An array from df with the dimensions [iteration, chain, parameters]

Examples

df <- data.frame( parameters = c('mu', 'mu'), iterations = c(0.345, 0.263), chains = c(1, 2), stringsAsFactors = FALSE ) df_to_stanarray(df)
#> , , parameters = mu #> #> chains #> iterations chain:1 chain:2 #> [1,] 0.345 0.263 #>