Re: [R] Renaming objects

2008-08-28 Thread Gavin Simpson
On Thu, 2008-08-28 at 07:39 -0400, stephen sefick wrote: > names, colnames, rownames <- list of names > I think it depends on what you are renaming? Those alter the dimnames of objects that have them, not the names of the objects themselves. I think a short answer to the question is no. There is

Re: [R] Renaming objects

2008-08-28 Thread stephen sefick
names, colnames, rownames <- list of names I think it depends on what you are renaming? Stephen On Thu, Aug 28, 2008 at 4:03 AM, Williams, Robin <[EMAIL PROTECTED]> wrote: > Hi, > Is there any quick and easy way to rename a number of objects, without > having to rename each one individually and

[R] Renaming objects

2008-08-28 Thread Williams, Robin
Hi, Is there any quick and easy way to rename a number of objects, without having to rename each one individually and then remove the old one? And if so, is there anything I can do to adjust the associated comments accordingly? Thanks for any help, Robin Williams Met Office summer intern - Heal

Re: [R] renaming objects

2008-03-04 Thread Gabor Grothendieck
You might be able to just read in that single column rather than read the file in chunks by using colClasses arg of read.table with "NULL" for all columns except the one you want. The sqldf package is another way -- see example 6 on the home page. You specify what you want using SQL: http://sqld

Re: [R] renaming objects

2008-03-04 Thread Giles . Crane
Thank you all for your enlightening replies. Hadley mentioned first that a mere assignment in R does not double storage. Hence once solution is: y <- x rm(x) Gabor gave a deeper solution which permits assigning a second name: makeActive Binding("y",function() x, .GlobalEnv) The reason for my qu

Re: [R] renaming objects

2008-03-03 Thread Prof Brian Ripley
On Mon, 3 Mar 2008, Nordlund, Dan (DSHS/RDA) wrote: [..., quoting Hadley Wickham] gc() >>> used (Mb) gc trigger (Mb) max used (Mb) >>> Ncells 133095 3.6 35 9.4 35 9.4 >>> Vcells 87049 0.7 786432 6.0 478831 3.7 a <- runif(1e7) gc() >>>

Re: [R] renaming objects

2008-03-03 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Rolf Turner > Sent: Monday, March 03, 2008 4:37 PM > To: hadley wickham > Cc: r-help; [EMAIL PROTECTED] > Subject: Re: [R] renaming objects > > > On 4/03/2008, at

Re: [R] renaming objects

2008-03-03 Thread Rolf Turner
On 4/03/2008, at 11:48 AM, hadley wickham wrote: > On Mon, Mar 3, 2008 at 4:37 PM, Rolf Turner > <[EMAIL PROTECTED]> wrote: >> >> On 4/03/2008, at 10:38 AM, Ericka Lundström wrote: >> >>> On 03/03/2008, at 22.20, [EMAIL PROTECTED] wrote: Is there a way to rename R objects? I am looki

Re: [R] renaming objects

2008-03-03 Thread Benilton Carvalho
or, in other terms: > set.seed(1) > x <- runif(1e7) > x.add <- tracemem(x) > y <- x > y.add <- tracemem(y) > identical(x.add, y.add) [1] TRUE ie, both objects have the same memory address - therefore, not a copy: > x.add [1] "<0x200>" > y.add [1] "<0x200>" now, observe what happens whe

Re: [R] renaming objects

2008-03-03 Thread Ravi Varadhan
5:48 PM To: Rolf Turner Cc: r-help; [EMAIL PROTECTED] Subject: Re: [R] renaming objects On Mon, Mar 3, 2008 at 4:37 PM, Rolf Turner <[EMAIL PROTECTED]> wrote: > > On 4/03/2008, at 10:38 AM, Ericka Lundström wrote: > > > On 03/03/2008, at 22.20, [EMAIL PROTECTED] wrote: >

Re: [R] renaming objects

2008-03-03 Thread Gabor Grothendieck
This does not really answer your question but the following lets you refer to an object by a second name although the object still has its original name as well. > a <- 3 > makeActiveBinding("b", function() a, .GlobalEnv) NULL > b [1] 3 > a <- 4 > b [1] 4 On Mon, Mar 3, 2008 at 4:20 PM, <[EMAIL

Re: [R] renaming objects

2008-03-03 Thread hadley wickham
On Mon, Mar 3, 2008 at 4:37 PM, Rolf Turner <[EMAIL PROTECTED]> wrote: > > On 4/03/2008, at 10:38 AM, Ericka Lundström wrote: > > > On 03/03/2008, at 22.20, [EMAIL PROTECTED] wrote: > >> Is there a way to rename R objects? > >> I am looking for a way to rename objects > >> without making new o

Re: [R] renaming objects

2008-03-03 Thread Rolf Turner
On 4/03/2008, at 10:38 AM, Ericka Lundström wrote: > On 03/03/2008, at 22.20, [EMAIL PROTECTED] wrote: >> Is there a way to rename R objects? >> I am looking for a way to rename objects >> without making new objects. >> >> #For example: >> x = c(1:40) >> # I wish to use a function to rename x, al

Re: [R] renaming objects

2008-03-03 Thread Ericka Lundström
On 03/03/2008, at 22.20, [EMAIL PROTECTED] wrote: > Is there a way to rename R objects? > I am looking for a way to rename objects > without making new objects. > > #For example: > x = c(1:40) > # I wish to use a function to rename x, already created, to y, > perhaps by > obj.rename(x,y) > # or >

[R] renaming objects

2008-03-03 Thread Giles . Crane
Is there a way to rename R objects? I am looking for a way to rename objects without making new objects. #For example: x = c(1:40) # I wish to use a function to rename x, already created, to y, perhaps by obj.rename(x,y) # or obj.rename("x","y") There are numerous examples of renaming variables