Python 如何将R列表转换为等效的Rpy2对象?

Python 如何将R列表转换为等效的Rpy2对象?,python,r,rpy2,Python,R,Rpy2,我有一个R对象定义为 seasonal = list(order = c(0, 0, 0), period = scalar) 我需要在Rpy2中传递的等效对象中转换它。请帮忙 from rpy2.robjects.vectors import ListVector, IntVector # if the order of the element does not matter seasonal = ListVector({'order': IntVector((0,0,0)), 'perio

我有一个R对象定义为

seasonal = list(order = c(0, 0, 0), period = scalar)
我需要在Rpy2中传递的等效对象中转换它。请帮忙

from rpy2.robjects.vectors import ListVector, IntVector
# if the order of the element does not matter
seasonal = ListVector({'order': IntVector((0,0,0)), 'period': scalar})
# if the order matters
seasonal = ListVector([('order', IntVector([0,0,0])),
                       ('period', scalar)])
文档中至少提到了
ListVector

文档中至少提到了
ListVector

传递给什么?您的问题描述不清楚。你可能想多花几行文字来解释一下你到底想在这里做什么。我的问题是将上面的行翻译成Rpy2中的正确行。我似乎在文档中找不到任何列表向量对象。传递给什么?您的问题描述不清楚。你可能想多花几行文字来解释一下你到底想在这里做什么。我的问题是将上面的行翻译成Rpy2中的正确行。我似乎在文档中找不到任何列表向量对象。