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
>>
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
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,
>
>
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
4 matches
Mail list logo