I have an R data frame stored in Database02.Rda. Download it
import rpy2.robjects as robjects
robjects.r.load("Database02.Rda")
works great. However:
print(robjects.r.names("df"))
gives
NULL
Also, as an example, column 214 (213, counted starting at 0), is called REGION.
print(robjects.r.table(robjects.r["df"][213]))
works great:
Region 1 Region 2 ...
9811 3451 ...
but we must also be able to do
print(robjects.r.table("df$REGION"))
This, however, leads to
df$REGION
1
(which also applies to column names that do not exist at all); also:
print(robjects.r.table(robjects.r["df"]["REGION"]))
gives an error:
TypeError: SexpVector indices must be integers, not str
docs , python. , , python/rpy2? , - dict python, ? . ?
R, python, rpy2, :
R: 3.2.2
python: 3.5.0
rpy2: 2.7.8