Displaying 1 result from an estimated 1 matches for "makemodelframe".
2006 Mar 23
2
invalid variable type in model.frame within a function
...2300376
6  -0.7418800 -0.1610305  0.4057340 -0.2280754
7  -1.1420962 -0.9363492 -0.4811192 -0.9258711
8   0.3507427  1.8744646  1.3227931  0.5292313
9   1.4196519  0.1340283 -1.3970614 -0.7189726
10 -1.0164708 -0.2044681 -0.6825873 -0.1719102
However, doing this inside another function like this:
makemodelframe <- function(formula,data,weights) {
    mf=model.frame(formula=formula,data=data,weights=weights)
    mf
}
produces the following error:
> makemodelframe(mf1,jet,weights=rvar)
Error in model.frame(formula, rownames, variables, varnames, extras,
extranames,  : 
    invalid variable type
Sea...