Skip to content
Prev 360676 / 398503 Next

undefined columns selected!

First, type
   names(msub)
and then type
   cn
and compare the output.

Probably, you will find a name in cn that is not among the names of msub.

To maybe make it easier to see the missing column(s), you can type

  setdiff(cn, names(msub))

The expression
  msub[,cn]
is intended to select columns from msub. That error message means that you
are trying to select one or more columns that are not there.

Or perhaps Bert Gunter is correct, and it should be
  msub[,'cn']
but I believe that if that were the case the error message would likely be
different. Without more information we can't be sure.

-Don