import rpy2
import numpy as np
import rpy2.robjects.numpy2ri
rpy2.robjects.numpy2ri.activate()
%load_ext rpy2.ipython
The rpy2.ipython extension is already loaded. To reload it, use: %reload_ext rpy2.ipython
df = np.array([(1, 2), (2, 3), (4, 5)], dtype=[('x', 'f4'),('y', 'f4')])
%%R -i df
require("ggplot2")
ggplot(df, aes(x = x, y = y)) + geom_point()