Jupyter中的R内联图 [英] R inline plots in Jupyter

查看:152
本文介绍了Jupyter中的R内联图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过 Binder 项目界面在Jupyter中运行R,尽管问题可能更笼统.例如,该问题可能与长期休眠的问题 a>关于Mac OS上的Jupyter.我通过 conda 添加了r-essentials,r-rzmq和r-repr. IRKernel和IRDisplay是r-essentials的一部分.但是,当我尝试绘制任何东西时,没有输出.确实,似乎没有图形输出选项.我在这里想念什么?在python笔记本中没有问题,但是R没有运气.

I am trying to run R in Jupyter through the Binder project interface, though the question may be more general. For instance it question may be related the long-dormant one about Jupyter on Mac OS. I have the r-essentials, r-rzmq and r-repr added through conda. IRKernel and IRDisplay are part of r-essentials. However, when I try to plot anything, there is no output. Indeed, it looks like there are no graphics output options. What am I missing here? There is no problem in python notebooks, but no luck with R.

capabilities()
jpeg FALSE
png FALSE
tiff FALSE
tcltk TRUE
X11 FALSE
aqua FALSE
http/ftp TRUE
sockets TRUE
libxml TRUE
fifo TRUE
cledit FALSE
iconv TRUE
NLS TRUE
profmem TRUE
cairo FALSE
ICU TRUE
long.double TRUE
libcurl TRUE

推荐答案

好,所以@hrbrmstr指出U. Anaconda'.我可以内联绘图通过使用Dockerfile来工作,并使用apt-get IRKernel安装R根据官方指示通过CRAN:

OK, so as @hrbrmstr points out 'Ugh. Anaconda'. I could get inline plotting to work by using a Dockerfile, and installing R using apt-get IRKernel via CRAN, as per official instructions:

# Set default CRAN repo
RUN echo 'options("repos"="http://cran.rstudio.com")' > .Rprofile

# Install IRkernel
RUN Rscript -e "install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))" -e "devtools::install_github('IRkernel/IRkernel')" -e "IRkernel::installspec(user = FALSE)"

这篇关于Jupyter中的R内联图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆