Экспорт PDF в рельсы

В R я могу легко добавлять элементы в список:

mylist = list()
mylist[[1]] = c(1,2)
mylist[[2]] = c(2,3)
mylist[[length(mylist)+1]] = c(3,4)

Как мне это сделать в rpy2? Я использую rpy2 2.1.9. Я попробовал следующее, но это не сработало

import rpy2.robjects as robjects
a = robjects.r('list()')
b = robjects.IntVector([1,2])
a[0] = b
IndexError: Index out of range.
a[1] = b
IndexError: Index out of range.
aa = a.__add__(b) # But this makes a list out of the vector
aa.r_repr()
'list(1L, 2L)'
# We wanted something like the following instead:
aaa = robjects.r('list(c(1,2))')
aaa.r_repr()
'list(c(1, 2))'
5
задан highBandWidth 22 March 2011 в 16:51
поделиться