Re: [R] how to change the class of a group of objects

2009-11-24 Thread Ben Mazzotta
at can actually work as dist objects, you might try the above line though. > > Erik > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >> On Behalf Of Ben Mazzotta >> Sent: Monday, November 23, 2009 4:51 PM >>

Re: [R] how to change the class of a group of objects

2009-11-23 Thread Henrique Dallazuanna
Try this: assign("a", `class<-`(get("a"), "character")) On Mon, Nov 23, 2009 at 8:51 PM, Ben Mazzotta wrote: > Dear R users, > > I would like to change the class of a group of objects in R memory from > "numeric" to "dist". I can manipulate the class using > > class(foo) <- bar > > but I cannot

Re: [R] how to change the class of a group of objects

2009-11-23 Thread Erik Iverson
Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Ben Mazzotta > Sent: Monday, November 23, 2009 4:51 PM > To: r-help@r-project.org > Subject: [R] how to change the class of a group of objects > > Dear R users, > >

[R] how to change the class of a group of objects

2009-11-23 Thread Ben Mazzotta
Dear R users, I would like to change the class of a group of objects in R memory from "numeric" to "dist". I can manipulate the class using class(foo) <- bar but I cannot get the same command to work on groups of variables. When I use for() loops and lists of names, inevitably I have to specify