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
I’d try as a general approach using rpy2 and something along the lines of:
Then whatever commands you’re doing to ‘r_var_name’ using ‘ltm’ package functions inside further r(“blah”) statements.
E.g. getting the coefficients for one of the ltm package examples: