Displaying 1 result from an estimated 1 matches for "nattribs".
Did you mean:
attribs
2007 Aug 22
1
"subscript out of bounds" Error in predict.naivebayes
...invoked the predict
function, it kept giving me the following message:
# my data set has 1 response variable and 9318 independent variables
Error in FUN(1:9319[[4L]], ...) : subscript out of bounds
# Here's what traceback() returns
10: FUN(1:9319[[4L]], ...)
9: lapply(X, FUN, ...)
8: sapply(1:nattribs, function(v) {
nd <- ndata[v]
if (is.na(nd))
rep(1, length(object$apriori))
else {
prob <- if (isnumeric[v]) {
msd <- object$tables[[v]]
dnorm(nd, msd[, 1], msd[, 2])
}
else object$tables[[v]][,...