# 1. From rpy2 to numpy # R vectors or arrays can be converted to numpy arrays using numpy.array() or numpy.asarray(). import numpy as np ltr = robjects.r.letters ltr_np = np.asarray(ltr) print(ltr_np) # 2. From numpy to rpy2 # The activation (and deactivation) of the automatic conversion of numpy objects into rpy2 objects can be made with: from rpy2.robjects import numpy2ri numpy2ri.activate() numpy2ri.deactivate()