@@ -251,7 +251,7 @@ is_chain_list <- function(x) {
251251 return (FALSE )
252252 }
253253 check1 <- ! is.data.frame(x ) && is.list(x )
254- dims <- try(vapply (x , function (chain ) length(dim(chain )), integer( 1 )), silent = TRUE )
254+ dims <- try(sapply (x , function (chain ) length(dim(chain ))), silent = TRUE )
255255 if (inherits(dims , " try-error" )) {
256256 return (FALSE )
257257 }
@@ -271,7 +271,7 @@ validate_chain_list <- function(x) {
271271 }
272272 }
273273 if (n_chain > 1 ) {
274- n_iter <- vapply (x , nrow , integer( 1 ) )
274+ n_iter <- sapply (x , nrow )
275275 same_iters <- length(unique(n_iter )) == 1
276276 if (! same_iters ) {
277277 abort(" Each chain should have the same number of iterations." )
@@ -302,7 +302,7 @@ chain_list2array <- function(x) {
302302 n_iter <- nrow(x [[1 ]])
303303 param_names <- colnames(x [[1 ]])
304304 } else {
305- n_iter <- vapply (x , nrow , integer( 1 ) )
305+ n_iter <- sapply (x , nrow )
306306 cnames <- sapply(x , colnames )
307307 param_names <- if (is.array(cnames ))
308308 cnames [, 1 ] else cnames
@@ -437,7 +437,7 @@ apply_transformations.array <- function(x, ..., transformations = list()) {
437437
438438rename_transformed_pars <- function (pars , transformations ) {
439439 stopifnot(is.character(pars ), is.list(transformations ))
440- has_names <- vapply (transformations , is.character , logical ( 1 ) )
440+ has_names <- sapply (transformations , is.character )
441441 if (any(has_names )) {
442442 nms <- names(which(has_names ))
443443 for (nm in nms ) {
0 commit comments