Skip to content
Prev 39850 / 63424 Next

help with eval()

On Mon, Apr 18, 2011 at 5:51 PM, Terry Therneau <therneau at mayo.edu> wrote:
Try using do.call.  Using the built in BOD to illustrate, we first try
the posted code to view the error:
+     fit <- lm(dcall, data=BOD, model=FALSE)
+     model.frame(fit)
+ }
Error in model.frame(formula = dcall, data = BOD, drop.unused.levels = TRUE) :
  object 'dcall' not found
+     fit <- do.call("lm", list(dcall, data = BOD, model = FALSE))
+     model.frame(fit)
+ }
demand Time
1    8.3    1
2   10.3    2
3   19.0    3
4   16.0    4
5   15.6    5
6   19.8    7