I have a numpy 2D array self.sub and i want to use it in rpy2 kmeans. k = robjects.r.kmeans(self.sub,2,20) i always get the following error: valueError: nothing can be done for the type at the moment! what can i do?
相关问题
- Rpy2 in a Flask App: Fatal error: unable to initia
- Jupyter OSError 0x7e when loading rpy2
- Unable to install rpy2 on Mac OS X 10.9
- Install and use RPy2 (using conda) so that it uses
- Calling R functions in rpy2 error - “argument is m
相关文章
- Installing the R interpeter and R as a shared libr
- Ipython notebook crash using rmagic extension
- Rpy2 not finding package
- Multidimensional/multivariate dynamic time warping
- rpy2 import is not working
- rpy2 install problems on debian
- Statistics Tests (Kolmogorov and T-test) with Pyth
- Prepare a python string for R using rpy2
From the rpy2 docs, R matrices are just vectors with their dim attribute set. So for a numpy two-dimensional array x
You have to transpose the numpy array because R fills matrices by columns.
Edit: Actually, you could just set byrow=True in the R matrix function, and then you wouldn't need to transpose.