Call the function with quotes, so:
model.fun <- "glm"
rslt <- do.call(model.fun,model.opt)
On Wed, Jul 28, 2010 at 7:30 PM, darckeen wrote:
>
> Thanks for your helpful response.
>
> I have a related question, i would like to further generalize the function
> by having the call arg of do.call f
Thanks for your helpful response.
I have a related question, i would like to further generalize the function
by having the call arg of do.call function being referenced. Like this:
model.fun <- glm
model.opt <- list(y1~1,data=df,family="binomial")
rslt <- do.call(model.fun,model.opt)
This wo
Try this:
do.call(glm, list(y ~ 1, data = df, family = 'binomial'))
On Wed, Jul 28, 2010 at 5:23 PM, darckeen wrote:
>
> I was wondering how i can get a list of arguments to evaluate within
> function
> call. I'd like to be able do something like this:
>
>
> #mod <- glm(y~1,data=df,family="b
I was wondering how i can get a list of arguments to evaluate within function
call. I'd like to be able do something like this:
#mod <- glm(y~1,data=df,family="binomial")
opt <- list(family="binomial")
mod <- glm(y~1,data=df,opt)
Any idea how this can be done properly? TIA
--
View this mes
4 matches
Mail list logo