Possible to pass matrices of 0 rows to rstan?

Although stan lets me declare a matrix[0,2] data object, I can’t seem to pass such an object to rstan. Is there some trick, or am I just asking too much? :)

For some reason, when conditions in R caused the matrix to have 0 rows, it also changed from numeric to logical entries. Forcing it back to numeric with matrix(as.numeric(myobject),ncol=2) resolved the problem of passing data to stan.

1 Like

Thanks for writing back with the solution.