Q:

How to pass a string as an argument to a `do.call` command?

How can I pass a string (e.g. "na.rm=TRUE") as an argument to a do.call command? 
For example this works as expected: 
> do.call(mean, list(1:10, na.rm=TRUE))
[1] 5.5

But what if I get the argument na.rm=TRUE as a string: "na.rm=TRUE"? If I try the following then it fails: 
> do.call(mean, list(1:10, "na.rm=TRUE"))
Error in mean.default(1:10, "na.rm=TRUE") : 
  'trim' must be numeric of length one
> do.call(mean, list(1:10, na.rm="na.rm=TRUE"))
Error in if (na.rm) x <- x[!is.na(x)] : 
  argument is not interpretable as logical

So given an argument in form of a string ("na.rm=TRUE"), how can I use it in a do.call command? 
To give a bit more background, the GUI in question is for dcast in reshape2. The user can input in two separate boxes: 

the function name 

say, user_fun <- "mean", that is then passed to dcast(fun.aggregate=get(user_fun))

the function args

say, user_ags <- "na.rm=TRUE", that is then passed to dcast(...) via do.call

So at the end of the day it would look something like: 
do.call(dcast, list(data_set, form, 
                     fun.aggregate=user_fun, user_ags))

As you can see, I have trouble with fitting the user_ags into do.call. For all I know the user_ags can contain any number of arguments in it and of any possible type (say, user_ags <- "na.rm=TRUE, other.arg='both', yet.another=NULL"). 
So I am looking for a generic way to parse such a string, such as a eval(parse(text="")) approach or similar. I tried various combinations of eval, parse, deparse, substitute, all to no avail..

A:

Here's a method that does not use eval but does wrap the params in a fake function call and uses parse to extract them
#sample function
myfun<-function(...) {
    print(list(...))
}

strparam <- "na.rm=TRUE, plot=F, age=15"

params <- as.list(parse(text=paste0("f(", strparam , ")"))[[1]])[-1]

do.call(myfun,params)

