Thankyou very much M. Weylandt. i was actually more interested in knowing about the error. I got the point.Thankyou elisa
> From: michael.weyla...@gmail.com > Date: Thu, 7 Mar 2013 11:15:36 +0000 > Subject: Re: [R] Error: no 'dimnames' attribute for array > To: eliza_bo...@hotmail.com > CC: r-help@r-project.org > > On Thu, Mar 7, 2013 at 11:02 AM, eliza botto <eliza_bo...@hotmail.com> wrote: > > > > Dear XpeRts, > > I prepared a no qoute Character string by the following command > > > > s<-noquote(paste (b1, collapse=",")) > > > > where, b1 is the vector of 24 intergers. > > > >> dput(b1) > > > > c(1L, 2L, 6L, 7L, 12L, 16L, 17L, 20L, 21L, 23L, 25L, 34L, 46L, 48L, 58L, > > 64L, 65L, 68L, 82L, 97L, 98L, 101L, 113L, 115L) > > > >> dput(s) > > > > structure("1,2,6,7,12,16,17,20,21,23,25,34,46,48,58,64,65,68,82,97,98,101,113,115", > > class = "noquote") > > > > I want to use "s" in the following command > > > > matb1<-res[,c(s))] > > > > The objective is to call those columns of matrix "res", whose numbers have > > been defined in "s". > > But when i plug "s" into "matb1" i get the following error > > > > Error: no 'dimnames' attribute for array > > > > How can i get rid of it?? > > thanks in advance > > I may be way off-base here, but can't you just use res[, b1]? > > As to the explanation as to why you get that error, let's just say > it's because c(s) doesn't result in a numerical vector and leave it at > that. > > Cheers, > MW > > > > > Eliza > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help@r-project.org mailing list > > 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 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.