1. vector= robjects.FloatVector([4,3,2,2,1,2,4,5])
2. print("vector is: ",type(vector),vector)
3. cal = robjects.r('''
4. vector
5. '''
6. )
7. print('this is type of cal', type(cal()))
Hi all,
I have encountered a very strange problem. I was trying to pass a python float list into R code. In my example, I'm passing [4,3,2,2,1,2,4,5] to R code. My code is above. Before executing R code, the result of print statement on second line is my type of my vector is a float vector. However, after I execute R code from line 3 to line 6, I print the type of vector a again at line 7, the type of my vector becomes a Boolean vector. Does anyone know how can I solve this problem or how can I pass a vector into R? Thank you!
Best regards,
Yifan