Skip to content
Prev 369642 / 398503 Next

Force argument to have quotes

Harold:

As a general rule, if you are using eval(parse(...)) you are doing it
poorly in R; cf

library("fortunes")
fortune(106)

Why is something like this not suitable:

fun1 <- function(a1,a2,a3 = c("hi","by"))
{
   cat(a3,a1+a2,"\n")
}
hi by 3
whoopee 3

... or, if you want to include the function as an argument of a list:
For which you can do stuff like:
hi by 7
whoopee 7

etc. etc.
See ?do.call

Cheers,
Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Tue, Jun 6, 2017 at 8:01 AM, Doran, Harold <HDoran at air.org> wrote: