Change jupyter notebook theme to highlight R functions - r

I'm using the R programming language with jupyter notebook, but functions are not highlighted like for Python. Is there a way to modify the default theme?
Just to be clear, below I posted 2 images to show the difference between jupyter notebook and RStudio:
as you can see, functions like length, sort etc. are painted with their own color.

Related

Is there a way to collapse output produced in a Jupyter notebook?

I am creating a Jupyter notebook to demo some functions that I have created and the outputs they produce. Is there a way to setup a Jupyter notebook such that any output produced after running a cell appears within an already collapsed cell? My motivation for this is that large output is printed by all of my functions, and I would prefer for the notebook to not become cluttered as I am demoing the functions.
Thank you in advance!

Octave in Jupyter Notebook - Opening 3D plot in an external window for interactive use

Is it possible using Octave in Jupyter Notebook to open plots in an external window so that they can be manipulated (zooming in/out, rotating)?
I hoped there would be some switch so that I could use them inline (as it is by default) but if need be, I could open them in an external window to manipulate it the way like in GNU Octave GUI. After checking what I need, I would switch back to inline.
I looked for some hints. I found this %%octave -g in octavemagic: Octave inside IPython. Unforutunately, it doesn't work for me when using Octave kernel.
I found something about inline plotting in An Octave kernel for Jupyter (Configuration section) but it doesn't look like it could help anything in regard to switching on/off it from the notebook.
For example, I would like the following code to invoke an external window.
y=-10:0.4:10+eps;
[xx,yy]=meshgrid(x,y);
zz= sin(sqrt(xx.^2+yy.^2))./(sqrt(xx.^2+yy.^2));
surf(xx,yy,zz)
view(-35,45)
It looks like that I have finally found the answer here:
https://github.com/Calysto/octave_kernel/issues/98
https://github.com/Calysto/octave_kernel/issues/6
https://am111.readthedocs.io/en/latest/jmatlab_use.html
%plot gnuplot - switch to using external window
%plot inline - switch to using inline plotting

Is there a way to write down chemical equations in jupyter notebook by using external packages for Mathjax?

I can't seem to figure out how to write down chemical equations in Jupyter notebook. How do we install mhchem for Mathjax to use inside Jupyter notebook?
Add the following code on top of your jupyter notebook:
$$\require{mhchem}$$
here you can find the detailed explanation on how to use and write chemical equations in jupyter notebook
https://notebooks.azure.com/OUsefulInfo/projects/gettingstarted/html/3.1.1%20Chemical%20Equations.ipynb
and without any extension's you can do as well
from IPython.display import display, Math, Latex
display(Math(r'F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx'))
display(Math(r'\ce{H2O}'))
try these in jupyter

How to use inline code in markdown in Jupyter with R

How to use inline code in markdown in Jupyter with R?
CODE CELL
n <- 8
MARKDOWN CELL
The Number is {{n}}
What would be the correct syntax in Jupyter Markdown for R? Is it even possible?
In case you haven't done it already, you might want to give the python markdown extension a shot, that adds the markdown inline code functionality for Python to Jupyter notebooks. On their github they claim:
The Python Markdown extension allows displaying output produced by the current kernel in markdown cells. The extension is basically agnostic to the kernel language, however most testing has been done using Python.
Installation instructions are on the github page of the nbextensions. Make sure you'll enable the python markdown extension using a jupyter command or the extension configurator.
Calling variables then should work inside a markdown cell with the {{var-name}} syntax that you've already given (described in the readme of the corresponding github page (linked in the wiki)).
If this doesn't help, you might want to join the discussion of the corresponding issues in the issue trackers for ipython and jupyter.

R leaflet package inline in IPython Notebook

I'm using R in Ipython Notebook with R line and cell magics. All of my R plots print automatically inline except for the R package leaflet which opens in a new browser tab.
I've tried using %capture to capture the output. I've also tried doing different versions of --inline.
In knitr, the map is included inside the file following the code chunk. Any idea on how to get this functionality in ipython notebook using R?
Thanks in advance for any and all help.
Edit:
%%capture only works with strings.
You can display interactive maps inline using rMaps.
There is a demonstration notebook here:
http://nbviewer.ipython.org/github/ipython/front-to-back/blob/master/R_demo.ipynb

Resources