You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Just found a bug in check_pic_stat due to recent R version updates - new way of handling || boolean.
If "stats" is not NULL and length>1 (which happens any time there is a list of unit trees used in caluclate_pic_stat ), it throws this error:
Error in names(stats) == "" || length(stats) == 0 :
'length = 6' in coercion to 'logical(1)'
Think I have fixed it by adding an additional any() to the first else if() statement, ie:
check_pic_stat <- function (stats)
{
if (is.null(stats))
stats <- default_pic_stat()
else if (!is.list(stats) || is.null(names(stats)) || any(any(names(stats) ==
"" )|| length(stats) == 0))
stop("'stats' must be a named list with at least one element")
else if (!all(sapply(stats, is.function)))
stop("All elements of stats must be functions")
stats
}
But please fix in any future releases.
The text was updated successfully, but these errors were encountered:
Hi,
Just found a bug in check_pic_stat due to recent R version updates - new way of handling || boolean.
If "stats" is not NULL and length>1 (which happens any time there is a list of unit trees used in caluclate_pic_stat ), it throws this error:
Error in names(stats) == "" || length(stats) == 0 :
'length = 6' in coercion to 'logical(1)'
Think I have fixed it by adding an additional any() to the first else if() statement, ie:
check_pic_stat <- function (stats)
{
if (is.null(stats))
stats <- default_pic_stat()
else if (!is.list(stats) || is.null(names(stats)) || any(any(names(stats) ==
"" )|| length(stats) == 0))
stop("'stats' must be a named list with at least one element")
else if (!all(sapply(stats, is.function)))
stop("All elements of stats must be functions")
stats
}
But please fix in any future releases.
The text was updated successfully, but these errors were encountered: