Skip to content

Commit

Permalink
Merge pull request #492 from stan-dev/newdata-with-no-columns
Browse files Browse the repository at this point in the history
Allow 0-column newdata if positive number of rows
  • Loading branch information
bgoodri authored Dec 11, 2020
2 parents 779cc92 + 01fa44b commit e7317be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,9 @@ validate_newdata <- function(object, newdata = NULL, m = NULL) {
stop("NAs are not allowed in 'newdata'.", call. = FALSE)
}

newdata <- drop_redundant_dims(newdata)
if (ncol(newdata) > 0) {
newdata <- drop_redundant_dims(newdata)
}
return(newdata)
}

Expand Down

0 comments on commit e7317be

Please sign in to comment.