Skip to content
Back to formatted view

Raw Message

Message-ID: <49F89CBF.5010102@cognigencorp.com>
Date: 2009-04-29T18:30:23Z
From: Sebastien Bihorel
Subject: Evaluation of an expression as function argument

Dear R-users,

I would like to know if is it possible to set a function argument as an 
evaluated expression. I have tried several syntaxes, including the 
following example, but could not get it anything to run. The plot 
function is used here but I would like to later apply the same approach 
to other functions.

##########################
items <- c(expression(col=2),expression(pch=2))

for (in in seq(2)) {
  plot(1:10, eval(items[i]))
}
##########################

Thanks in advance for your input.

Sebastien