Feed on
Posts
Comments

Archive for the 'R' Category

Importing arrays from numpy to rpy2 can throw the following error: ValueError: Nothing can be done for the type <type ‘numpy.ndarray’> at the moment. To resolve, add the following to the top of your Python code: import rpy2.robjects.numpy2ri rpy2.robjects.numpy2ri.activate()

install a package in R from CRAN

to install a package from CRAN, launch R and type: > install.packages(‘package_name’)

convert FloatVector to numpy array

it’s easy to convert an rpy FloatVector object (fv_obj) to a numpy array: import np np.array(fv_obj)

More blogs about http://desk.stinkpot.org:8080/tricks.