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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -