What is equivalent to the following R code in Rpy2 in python?
Var1 = c("navy", "darkgreen") names(Var1) = c("Class1", "Class2") ann_colors = list(Var1 = Var1)
It is not clear what ann_colors . When evaluated in R, it gives:
> ann_colors $Var1 Class1 Class2 "navy" "darkgreen"
Is this a robject.ListVector ? I tried:
robjects.ListVector({"Class1": "navy", "Class2": "green"})
but this is not entirely true, because I'm not sure how to tell the ListVector object that the name of this object is Var1 , that is, something like list(Var1 = Var1) .
How can this be correctly translated to rpy2?
source share