Skip to content
Back to formatted view

Raw Message

Message-ID: <376e97ec0505110201398c62c5@mail.gmail.com>
Date: 2005-05-11T09:01:00Z
From: Fredrik Karlsson
Subject: Subset with selection variable from function argument. Is there another way?

Dear list,

I'm making my current code more generic and would like some advise.
The basic problem is subset and the name of the column to be compared
for selection.

What I've come up with is 

> data(mammals)
> set <- bottompremolars"
> subset(mammals, eval(parse(file="",text=set)) > 2)

This seems a bit odd.  Is there a nicer way?

/Fredrik