On Wed, Aug 18, 2010 at 8:58 AM, Jimmy Söderly <jimmy.sode...@gmail.com> wrote: > Hi everybody, > > I wanted to name a column vector (a variable). > > This is what I did : > > try<-matrix(1:4,nrow=4,ncol=1) > attr(try,"dimnames")<-list(NULL,"true value") > > Is it OK ?
Sure. You can also do: dimnames(try) <- list(NULL,"true value") or if you are creating the matrix, directly with: try <- matrix(1:4, nrow = 4, ncol = 1, dimnames = list(NULL, "true value") > > Thanks for your help, > Jimmy > > [[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. > -- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/ ______________________________________________ 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.