Using Jupyter Notebook to do R in Windows 10. Although I much prefer RStudio, for reasons not worth getting into, I cannot use it. I moved a notebook I made on RStudio from my personal computer to my work computer and was not able to generate the same graphs inline on jupyter. I could save them fine onto the disk though.
Anyone know why it's not working? This is similar to
r graphs in jupyter - unable to start png() device
Displaying ggplot2 graphs from R in Jupyter
But not exactly. Anyone know why I am unable to get graphs to show? I discovered that if I restart the Rkernel I can get one graph to show but not more.
I am not quite sure why it was complaining but after looking at what other graphing packages suggest, I found that I needed to install pandoc and restart jupyter.
You can install pandoc from here: https://github.com/jgm/pandoc/releases/tag/1.16.0.2
Related
I have a problem since that has to do with plotting in R and Rstudio. I am using a MacBook Pro 14'' with macOS Monterey Version 12.1. The RStudio version is 2022.12.0+353 (2022.12.0+353), and the R version is 4.2.2.
I was previously using R 4.2.0 and a previous version of RStudio and still the plots did not show up.
What happens is that as soon as I try to plot anything, the panel freezes and the only way to go forward is to press the red "stop" button of the console. Usually, the only way to go is to restart R because pressing the stop button is not enough. It happens with any plotting function that I am aware of, including ggplot(), hist(), and plot().
I have already tried to restart the laptop, to unload the packages and to update them.
Did anybody encounter a similar issue? It's quite puzzling to me.
Thanks,
Marco
I have already tried to restart the laptop, to unload the packages and to update them.
I solved the problem. my system did not recognise the Arial font. After installing it manually, ggplot worked again.
Thanks!
M
I followed the instructions in https://github.com/JuliaLang/IJulia.jl
using Pkg
Pkg.add("IJulia")
using IJulia
notebook()
After creating an IJulia notebook, it gets stuck at "In[*]" trying to calculate 1+1. I created a python notebook and the same code runs fine. The Julia prompt is also able to run this calculation.
Starting jupyter from the Anaconda console and running the same IJulia notebook does not show any error either.
The Julia kernel takes about 10 s to start, which seems to be a long time compared to the python kernel.
What could be the problem?
You are running into https://github.com/JuliaLang/IJulia.jl/issues/693. IJulia isn't working under Julia v0.7+ yet (at least on Windows). People are presumably working hard to fix this, so let's hope this issue vanishes soon.
Note, the link above contains a temporary fix, if you are willing to try.
I have an R notebook that I am trying to make into a Jupyter notebook using IRkernel, which I downloaded via Anaconda.
Everything works fine except when I try to use dygraphs, which just won't display the graph.
The only thing close to an answer I could find online is: https://doc.dataiku.com/dss/latest/R/dygraphs.html but I am not able to download the dataiku library for some reason.
I tried using conda install -c r r-dygraphs but it has made no difference.
On the dygraphs website they don't mention anything about using it in a Jupyter notebook so I'm not sure what to do. If it isn't supported on Jupyter, can someone point me to a close alternative to dygraphs that will work on Jupyter? The time series visualisation is really great on it which is why I want to implement it in my Jupyter notebook.
Thanks in advance!
If your error is something like:
ERROR while rich displaying an object: Error in file(file, "rb"): invalid 'description' argument
Then I think it's referring to not being able to plot the dygraphs in Jupyter. I would suggest checking out the "using" section on the documentation for R dygraphs. Although it doesn't strictly mention using dygraphs in Jupyter notebooks, it gives pointers for using them in R Console, R Markdown, and R Shiny. Lately I've been using them in an R shiny application and they've worked flawlessly, just as long as you set them up correctly. Also, just use:
install.packages('dygraphs')
in Jupyter notebooks to ensure successful installation and use. I've noticed that there are inconsistencies when running conda install commands (i.e. whether or not the package will end up working in Jupyter notebooks, RStudio, or both).
I think the problem is not in the install dygraphs, but it depends on jupyter notebook, this one can't appear dynamic graphic such as in RMarkdown.
I am trying to draw graph by R on linux,
when I run this code: plot(1,1)
a graph with messy code is drawn
I am using OS linux, R 3.4.1 , jupyter notebook
Cairo is used as device for drawing.
I have tried these methods:
trying another method in R
trying another font
trying utf-8 encode
but these are not work.
It should not be problem of jupyter notebook because I run R console and draw the graph, the same problem happened. It should be problems in R, or Cairo, or something between them.
I have solved it by reinstalling R.
I had this same problem on a Linux machine where I used a conda installed R system running in Jupyter Notebooks. The issue for me turned out to be missing fonts. I solved it by using conda to install fonts:
conda install -c anaconda fonts-anaconda
I initially tried, using RStudio, to install rgl using install.packages("rgl"), which appeared to have worked. It did give me a message that the binary is older than the source, and that it would install from the binary, but I received no other messages. However library(rgl) gets stuck and doesn't do anything.
I removed the package using remove.packages(rgl), and attempted to install from source using R CMD INSTALL rgl_0.95.1409.tar.gz. That gets stuck on "testing if installed package can be loaded." I had X11 installed, but I downloaded XQuartz 2.7.8 and tried again, with the same result.
?rgl::plot3d in RStudio does take me to the documentation for the plot3d function, so I think it installed, just not completely/successfully (rgl::plot3d as an attempt to call the plot3d function also results in endless computation).
However, I finally did manage to load rgl (and use plot3d) by manually launching the Xapp from the Terminal prior to loading the library in my current R session (just X in Terminal, xterm by itself doesn't seem to have the same effect). Can anyone explain why this might be the case, and if there is a workaround to avoid having to manually launch the Xapp? (I do not want to have an application running when I do not need it, but I will also probably sometimes forget to launch the Xapp prior to running this script.)
I'm running OS X Yosemite (10.10.5), RStudio 0.98.1103, R 3.1.3 3.2.2.
The 'rgl' package does not use XQuartz, but rather opens a separate X11 window. Not being able to launch X(11) automatically makes me think that either your system PATH does not have the X11 server in the search path or an environment variable needs to be fixed. I wasn't able to see any differences in the Sys.getenv() results after loading rgl but I see that I have these in my PATH: /usr/X11/bin:/usr/X11R6/bin1
For a while I was rather confused about this as well. The XQuartz.app appeared very similar to the the X11.app , showing up with the very similar icons, (both appearing in the Taskbar as "X".)