r - nomogram() of rms not working in a function -
i trying make following function work giving errors:
> mynomogram function(sfstr, mydf){ sf = as.formula(sfstr) library(rms) mod = ols(sf, mydf) dd = datadist(mydf) options(datadist='dd') plot(nomogram(mod)) } > > mynomogram('mpg~disp+hp+cyl', mtcars) error in value.chk(at, i, na, -nint, limval, type.range = "full") : variable disp not have limits defined datadist > > mynomogram('mpg~disp+hp+cyl', mtcars) error in design(x) : dataset dd not found options(datadist=)
where error , how can solved? help.
Comments
Post a Comment