[R] Error while using e1071 package

Jim Lemon drjimlemon at gmail.com
Tue Dec 8 22:24:26 CET 2015

Hi Partha,
Probably the first thing to be done is to see what:


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.


On Wed, Dec 9, 2015 at 1:16 AM, Partha Sinha <pnsinha68 at 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 at 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]]

More information about the R-help mailing list