Frage

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?

War es hilfreich?

Lösung

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).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top