Kernel: Python 3 (system-wide)
RPy2 in Python 3 (Ubuntu Linux) kernel using ggplot2
In [1]:
/usr/local/lib/python3.6/dist-packages/rpy2/robjects/pandas2ri.py:14: FutureWarning: pandas.core.index is deprecated and will be removed in a future version. The public classes are available in the top-level namespace.
from pandas.core.index import Index as PandasIndex
In [2]:
In [3]:
/usr/local/lib/python3.6/dist-packages/rpy2/robjects/lib/ggplot2.py:72: UserWarning: This was designed againt ggplot2 version 3.2.1 but you have 3.3.0
'have %s' % (TARGET_VERSION, ggplot2.__version__))
In [4]:
In [5]:
R/rpy2 DataFrame (32 x 11)
mpg | cyl | disp | ... | am | gear | carb |
---|---|---|---|---|---|---|
21.000000 | 6.000000 | 160.000000 | ... | 1.000000 | 4.000000 | 4.000000 |
21.000000 | 6.000000 | 160.000000 | 1.000000 | 4.000000 | 4.000000 | |
22.800000 | 4.000000 | 108.000000 | 1.000000 | 4.000000 | 1.000000 | |
21.400000 | 6.000000 | 258.000000 | 0.000000 | 3.000000 | 1.000000 | |
... | ... | ... | ... | ... | ... | |
15.800000 | 8.000000 | 351.000000 | 1.000000 | 5.000000 | 4.000000 | |
19.700000 | 6.000000 | 145.000000 | 1.000000 | 5.000000 | 6.000000 | |
15.000000 | 8.000000 | 301.000000 | 1.000000 | 5.000000 | 8.000000 | |
21.400000 | 4.000000 | 121.000000 | 1.000000 | 4.000000 | 2.000000 |
Plotting via a temp file
In [6]:
In [7]:
R[write to console]: `geom_smooth()` using formula 'y ~ x'
In [8]:
R[write to console]: `geom_smooth()` using formula 'y ~ x'
In [0]: