安裝 IRKernel

進入 R 的命令列,輸入下面的指令
就能安裝 IRKernel,以後就能在 jupyter 中使用 R

install.packages(c('rzmq','repr','IRkernel','IRdisplay'),
                 repos = c('http://irkernel.github.io/', getOption('repos')))
IRkernel::installspec()

錯誤訊息

interface.cpp:22:10: fatal error: 'zmq.h' file not found
#include <zmq.h>
         ^
1 error generated.
make: *** [interface.o] Error 1
ERROR: compilation failed for package 'rzmq'

解決

這時候就要將缺少的套件補齊

brew install czmq zmq

再執行一次最上面的安裝指令

接著在指令列執行輸入下面的指令

jupyter qtconsole --kernel=ir
jupyter console --kernel=ir

安裝成功後就可以看到
R_in_jupyter

Reference

Share on: TwitterFacebookEmail

Comments

Do you like this article? What do your tink about it? Leave you comment below

comments powered by Disqus

Published

Read Time

1 min

Category

Tech

Tags

Keep In Touch