Skip to content
Prev 180413 / 398503 Next

Function to read a string as the variables as opposed totaking the string name as the variable

As Hadley said, it's complex in general: the standard approach is to
assemble the arguments into a list and then use do.call -- ?do.call.
Undoubtedly, there are times where this won't do either (at least not
without some further tricks).

-- Bert

Bert Gunter
Genentech Nonclinical Biostatistics


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of hadley wickham
Sent: Thursday, May 14, 2009 11:41 AM
To: Lori Simpson
Cc: r-help at r-project.org; Max Rausch
Subject: Re: [R] Function to read a string as the variables as opposed
totaking the string name as the variable

On Thu, May 14, 2009 at 12:16 PM, Lori Simpson
<lori.simpson at dc-energy.com> wrote:
It's complex in general, but for cast you can just supply a string:

cast(table, paste(string_with_columns, "~ column4"))

Hadley