I have a list of lists in python like the following like the following:
test = [[4, 2, 5, 3], [5, 2], [6, 3, 2, 5, 5]]
I want to input this into dunn.test in R using rpy2.
However, I am not sure how to convert this into a list of numeric vectors (R).
I am trying:
py2.robjects.ListVector(test)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/rpy2/robjects/vectors.py", line 635, in __init__
kv = [(str(k), conversion.py2ri(v)) for k,v in tlist]
File "/usr/lib/python3/dist-packages/rpy2/robjects/vectors.py", line 635, in <listcomp>
kv = [(str(k), conversion.py2ri(v)) for k,v in tlist]
ValueError: too many values to unpack (expected 2)
What is the correct way of doing this?