Re: [R] assigning the class of an object

2013-09-11 Thread peter dalgaard
On Sep 10, 2013, at 23:49 , Rolf Turner wrote: >> > Hmmm. I did: > > x <- 42 > save(x,file="Robject.RData") > rm(list=ls()) > obj_name <- load("Robject.RData") > class(get(obj_name)) <- "myClass" > x > > and got: > > [1] 42 > attr(,"class") > [1] "myClass" > > (also got the familiar error me

[R] assigning the class of an object

2013-09-10 Thread Davis, Brian
I'm sure this has been answered before but alas my googlefoo is not that strong. I have several .Rdata files with a single object in them. I need to set the class of the object to "myClass". Unfortunately, I don't know the name of the object beforehand. Obviously I could ls() and get the name

Re: [R] assigning the class of an object

2013-09-10 Thread Rolf Turner
On 09/11/13 07:54, Davis, Brian wrote: I'm sure this has been answered before but alas my googlefoo is not that strong. I have several .Rdata files with a single object in them. I need to set the class of the object to "myClass". Unfortunately, I don't know the name of the object beforehand.

Re: [R] assigning the class of an object

2013-09-10 Thread Rolf Turner
On 09/11/13 09:16, peter dalgaard wrote: On Sep 10, 2013, at 22:56 , Rolf Turner wrote: On 09/11/13 07:54, Davis, Brian wrote: I'm sure this has been answered before but alas my googlefoo is not that strong. I have several .Rdata files with a single object in them. I need to set the class of

Re: [R] assigning the class of an object

2013-09-10 Thread William Dunlap
s" > env$zzz [1] 17 attr(,"class") [1] "someClass" Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Davis, Brian > Sent: Tue

Re: [R] assigning the class of an object

2013-09-10 Thread peter dalgaard
On Sep 10, 2013, at 22:56 , Rolf Turner wrote: > On 09/11/13 07:54, Davis, Brian wrote: >> I'm sure this has been answered before but alas my googlefoo is not that >> strong. >> >> I have several .Rdata files with a single object in them. I need to set the >> class of the object to "myClass".