Open
Description
Describe the bug
When trying to supply a list of matrices to an array[x, y, z] int, I get the following error:
“Error in mde(x) : ‘list’ object cannot be coerced to type ‘integer’”
To Reproduce
library(cmdstanr)
stan_file <- write_stan_file(
"data {
array[4, 3, 2] int x;
}
transformed data {
print(x);
}"
)
mod <- cmdstan_model(stan_file)
a <- matrix(1:6, nrow = 3, ncol = 2)
data = list(x = list(a, a, a, a))
fit <- mod$sample(
data = data,
fixed_param = TRUE,
chains = 1
)
Expected behavior
The data should be read into the model. Data is populated correctly if supplying a 3D integer array instead.
Operating system
macOS 13.4.1
CmdStanR version number
0.6.0