Re: [R] Renaming variables

2013-09-20 Thread John Kane
Depending on what your doing perhaps with() could help? Or assuming a data.frame or matrix, score[ , 25] will give you Score$X25 If you would supply a bit more information (and code) about what you are doing we probably can help more. John Kane Kingston ON Canada > -Original Message-

Re: [R] Renaming variables

2013-09-20 Thread Clint Bowman
or with(score.plot(X1, X2)) Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia,

Re: [R] Renaming variables

2013-09-20 Thread Aaron Mackey
On Fri, Sep 20, 2013 at 10:10 AM, Preetam Pal wrote: > I have 25 variables in the data file (name: score), i.e. X1,X2,.,X25. > > I dont want to use score$X1, score$X2 everytime I use these variables. > attach(score) plot(X1, X2) # etc. etc. -Aaron [[alternative HTML version delete

Re: [R] Renaming variables

2013-09-20 Thread Simon Zehnder
You haven't said yet, what object your 'data file' is. If you mean a data.frame I would use colnames(dataName) <- c("Col1Name", "col2Name", ….) Best Simon On Sep 20, 2013, at 4:10 PM, Preetam Pal wrote: > Hi, > > I guess this is pretty basic. > > I have 25 variables in the data file (name: s

Re: [R] Renaming variables

2011-06-14 Thread Dennis Murphy
Hi: names() typically has to do with the names associated with *components* of a data frame or list, which appears to be what you have, reading between the lines. Here's a toy example: > mydf <- data.frame(a = rnorm(5)) > mydf a 1 1.291952883 2 -0.136706733 3 0.219528682 4 -0.17483