Being a R user, I am learning to incorporate python command in R through reticulate
, I tried plotting graph using the plotnine
package in R but it returned the following error, can anyone help?
library(reticulate)
library(ggplot2)
pd <- import('pandas', as='pd',convert=FALSE)
p9 <- import('plotnine')
mpg_py <- r_to_py(mpg,convert=FALSE)
mpg_pd <- pd$DataFrame(data=mpg_py)
p9$ggplot(data=mpg_pd,p9$aes(x='displ',y='cty'))
# Error in py_call_impl(callable, dots$args, dots$keywords) :
# AttributeError: 'NoneType' object has no attribute 'f_locals'