The the column name must be quoted in the index: msubsub=msub[,"cn"]
Please go through a basic R tutorial or two if you want to learn to use R. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, May 4, 2016 at 6:05 AM, ch.elahe via R-help <r-help@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@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. ______________________________________________ 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.