Mohit Khanna <mohit.personal1...@gmail.com> writes: > I am trying the following code-- > > from rpy import * > r.library("ltm") > > dat= #some data frame or matrix > r.ltm(r('dat~z1')) > > error coming is--- > RPy_RException: Error in eval(expr, envir, enclos) : object 'dat' not found > > Please tell me the right way to call ltm function using rpy library
Your problem is that the 'dat' object is in the Python world but not in the R world. However, the expression r('dat~z1') is looking for a 'dat' object in the R world. So you must copy the Python object to the R world. I don't know if this will work in rpy, but it does work in rpy2. Rpy2 has much better possibilities than rpy. But just try it: r['=']('dat', dat) r.ltm(r('dat~z1')) -- Piet van Oostrum <p...@vanoostrum.org> WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list