Вопрос

Simple question that I can't seem to find the answer to. How would I get an attribute of an R object in rpy2? For example, what's the equivalent of the R code: m$eval in rpy2?

Это было полезно?

Решение

For R lists, $ is equivalent to [[ with a vector of length 1: foo$bar is equivalent to foo[["bar"]]. With rpy2 this would be foo.rx2('bar'), or foo[foo.index('bar')] (See extracting element, R-style).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top