The default R Notebook has a lot of prepopulated text. Is there a way to change this, so that when a new R Notebook is created, it is just a blank notebook?
On my machine (OSX) I can edit the template r_markdown_notebook.Rmd found at this location:
/Applications/RStudio.app/Contents/Resources/resources/templates
On Windows look inside the RStudio folder:
C:\Program Files\RStudio\resources\templates
On Ubuntu/Mint (Linux), you will need sudo:
/usr/lib/rstudio/resources/templates
Related
Installed WSL on Windows 10.
Installed Anaconda according to the Anaconda documentation with the following commands:
bash Anaconda3-2020.02-Linux-x86_64.sh
source ~/.bashrc
You can see the '(base)' in the beginning of each command input line, indicating the conda is activated.
Then I run jupyter notebook by typing:
jupyter notebook
Then I see the following changes as shown in the screen record.
Briefly, the WSL terminal window showed some information very quickly, but is changed to the windows powershell window before you could even tell the information that showed up. I know those information should contain a file and url for opening the jupyter notebook in the web browser. But they flashed out so quickly. Does anyone know why this happens?
Here is a dynamic graph of the Screen record of this issue:
Solved:
1. Wait for a bit more time on the windows cmd and the jupyter notebook running information will show up, where includes the url to open jupyter notebook in the web browser.
OR
Open up another wsl terminal, activate the same environment and type jupyter notebook list, which will show the current running jupyter notebook server. The url is also can be found there.
When I double click an R script (.R file) in order to open and edit it, nothing happens.
I expect it to open it in either R or RStudio but it doesn't.
I found a similar (old) question (Opening a .R file via a double click (Windows)) but the solution doesn't work for me.
I have tried:
- right-clicking and explicitly telling it to open it with RStudio
- set it as the default program to associate with this file type
- drag the script into RStudio
Anyone any idea whether it is Windows or R(Studio) related?
Running:
Windows 10 Pro
R version 3.6.1
RStudio version 1.2.1335
As the first comment suggest, it is likely a problem occuring while installing R or Rstudio. This would most likely be fixed by reinstalling Rstudio. If it doesnt i'd suggest checking out this Rstudio question.
Basically, you can manually create using the command prompt (start -> "cmd" -> enter), using
assoc .R=rfile
Ftype rfile="C:\Program Files\RStudio\bin\rstudio.exe" %1
changing the rstudio directory to the correct directory for your computer.
A less command-prompty solution might be available by following the steps described in this guide. However i did not test the latter approach.
I'm working with Jupyter Notebook version 4.1.0 and can't seem to manually select the save path.
How does one manually specify where a session is saved?
You can launch jupyter notebook from the command line from inside the desired folder path. This will set the current folder as the start of the directory tree in Jupyter.
If we already have a session running, we can select the option IPython Notebook (.ipynb), from the file menu, under the Download as option. After saving the Notebook to a desired path, we can open it using the method described above.
Using Anaconda, when opening Jupyter notebook it tries to use the /etc/fish shell which I have uninstalled. Reinstalled Anaconda, and still tries to use fish shell.
[Command not found: /bin/fish]
[Could not create a new process and open a pseudo-tty.]
I have edited /etc/shells to not contain reference to fish as well.
Is there a way to edit the Jupyter Preferences, Or am I missing something else?
For reference: IPython qtconsole opens fine.
SOLVED by:
Uninstalling iTerm2, Anaconda, fish and zsh shells.
Cleaning out /etc/shells file with references to fish and zsh
Edit Terminal (not iTerm2) bash_profile and /.bashrc file adding to top of files:
/.bashrc file:
export BASH_CONF="bash_profile"
/.bash_profile file:
export BASH_CONF="bashrc"
Reinstall Anaconda.
I am trying to use IPython Notebook with spark.
When I am in the spark installation directory, this command works well:
IPYTHON_OPTS="notebook --pylab inline" ./bin/pyspark
However, I can create notebooks only on the spark installation directory and its sub directories.
If I launch this command on another directory on my computer:
PYTHON_OPTS="notebook --pylab inline" /Users/poiuytrez/Documents/programs/spark/bin/pyspark
I get only a regular pyspark shell and not a notebook. Do you have any ideas of what could be wrong?
It looks like you might have left off the initial I in IPYTHON_OPTS in your second command?