Hi Partha, Probably the first thing to be done is to see what: object$tables
really is. The error message tells you that either "v" has become larger than the number of elements in the list/data frame "tables" or that "nd" has become larger than the number of columns in the element "v" (or both). Perhaps displaying the successive values as the code is run: for(v in 1:<some value>) { cat("v =",v,"\n") for(nd in 1:<some other value>) { cat("nd =",nd,"\n") ... } } will tell you where the error is occurring. Jim On Wed, Dec 9, 2015 at 1:16 AM, Partha Sinha <pnsinh...@gmail.com> wrote: > I am using R 3.2.2 on win-7 > > while using predict function with e1071 (naive bayes classifier) > I am getting the following error > "Error in object$tables[[v]][, nd] : subscript out of bounds" > > > pl help. > regards > Parth > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.