[R] undefined columns selected!

MacQueen, Don macqueen1 at llnl.gov
Wed May 4 17:08:08 CEST 2016


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



-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 5/4/16, 6:05 AM, "R-help on behalf of ch.elahe via R-help"
<r-help-bounces at r-project.org on behalf of r-help at r-project.org> wrote:

>
>Hi all,
>I know it seems simple but I am trying to copy a code and I don't know
>what is the problem with this command!
>
>    msubsub=msub[,cn]
>
>the error I get is : error in '[.data.frame '(msub, ,cn) : undefined
>columns selected 
> 
>Thanks for any help,
>Elahe
>
>______________________________________________
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://secure-web.cisco.com/17LbfsJ6l1TxAGGDaZPJaqSjzCIWn5E9CwPSSMrKL6TmF
>nzxq4NMk2_I5ZoRND9U7-DVdKRI4gQq-ksFm42c_Y4YLWER6RjmX7KA43TlJE090H6BW03h2ch
>R-AjcGVBd7OkbsupK4ILVvkOhZEs4oearHg3fxw5eGd1HheF2ZmV23Gk8iUz73qq3xABMYDqRs
>MimloONz77mr0nVciORpjobMGuDvIH69DttdwbXnkLyVgrlscdiOjTp_LjcdJMSFKqMjepMDxH
>iQGQfThQ4q3l5ZjSUts8soTR8Bg5R722f-4WJkevdYYreIEU3i0aH64_AdN7Hhn9lHL1MUOm0K
>Mg0IV4twClhcRjs7Bf5Qf9M/https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2F
>r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list