I figured this out. I had to do 'apt-get install r-cran-caret' and now it works!

On Fri, Jul 14, 2017 at 10:15 AM, Larry Martell <larry.mart...@gmail.com> wrote:
> Running this test script and it's throwing the exceptions shown. This
> is debian 10 with R 3.3.3, python 2.7. Can anyone offer any ideas on
> what is wrong?
>
> mport rpy2.robjects as robjects
>
> stroke = robjects.r('''
>         load(file.path("/opt/django/CAPgraph/capdata/lib/RPredictions/",
> "logisticRegressionModels.RData"))
>         load(file.path("/opt/django/CAPgraph/capdata/lib/RPredictions/",
> "newPatients.RData"))
>         newPatientsForStroke <- 
> transformFcn(NEWDATA=newPatients,MODEL="Stroke")
>         predictStroke <- predict(lrStroke,newPatientsForStroke)
>             ''')
>
> /usr/local/lib/python2.7/dist-packages/rpy2/rinterface/__init__.py:186:
> RRuntimeWarning: Warning:
>   warnings.warn(x, RRuntimeWarning)
> /usr/local/lib/python2.7/dist-packages/rpy2/rinterface/__init__.py:186:
> RRuntimeWarning:  namespace 'caret' is not available and has been
> replaced
> by .GlobalEnv when processing object 'lrStroke'
>
>   warnings.warn(x, RRuntimeWarning)
> /usr/local/lib/python2.7/dist-packages/rpy2/rinterface/__init__.py:186:
> RRuntimeWarning: Error in UseMethod("predict") :
>   no applicable method for 'predict' applied to an object of class "rfe"
>
>   warnings.warn(x, RRuntimeWarning)
> /usr/local/lib/python2.7/dist-packages/rpy2/rinterface/__init__.py:186:
> RRuntimeWarning: In addition:
>   warnings.warn(x, RRuntimeWarning)
> /usr/local/lib/python2.7/dist-packages/rpy2/rinterface/__init__.py:186:
> RRuntimeWarning: Warning message:
>
>   warnings.warn(x, RRuntimeWarning)
> /usr/local/lib/python2.7/dist-packages/rpy2/rinterface/__init__.py:186:
> RRuntimeWarning: In transformFcn(NEWDATA = newPatients, MODEL =
> "Stroke") :
>   warnings.warn(x, RRuntimeWarning)
> /usr/local/lib/python2.7/dist-packages/rpy2/rinterface/__init__.py:186:
> RRuntimeWarning:
>
>   warnings.warn(x, RRuntimeWarning)
> /usr/local/lib/python2.7/dist-packages/rpy2/rinterface/__init__.py:186:
> RRuntimeWarning:  bytecode version mismatch; using eval
>
>   warnings.warn(x, RRuntimeWarning)
> Traceback (most recent call last):
>   File "/opt/django/CAPgraph/capdata/lib/testR.py", line 14, in <module>
>     ''')
>   File "/usr/local/lib/python2.7/dist-packages/rpy2/robjects/__init__.py",
> line 362, in __call__
>     res = self.eval(p)
>   File "/usr/local/lib/python2.7/dist-packages/rpy2/robjects/functions.py",
> line 178, in __call__
>     return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/rpy2/robjects/functions.py",
> line 106, in __call__
>     res = super(Function, self).__call__(*new_args, **new_kwargs)
> rpy2.rinterface.RRuntimeError: Error in UseMethod("predict") :
>   no applicable method for 'predict' applied to an object of class "rfe"
>
> Thanks!

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to