Skip to content

Commit

Permalink
Bug fix in rearray
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbaums committed Feb 21, 2016
1 parent 63a9b2b commit ddf335c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/rearray.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
#' a3 <- rearray(simgrowth, param='log.r', probs=seq(0, 1, 0.1))
#' str(a3)
rearray <- function(x, param, fields, regex=FALSE, ...) {
if(missing(param)) param <- '.*\\[\\d+(,\\d+)+\\]'
if(missing(param)) {
param <- '.*\\[\\d+(,\\d+)+\\]'
regex <- TRUE
}
results <- jagsresults(x, param, regex=regex, ...)
if(!length(results))
stop(sprintf('No arrays found in object %s', deparse(substitute(x))))
Expand Down

0 comments on commit ddf335c

Please sign in to comment.