Skip to content

Commit 3cbef9a

Browse files
upd README
1 parent e01778e commit 3cbef9a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

R/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# R Markdown Examples
1+
## R Markdown Examples
22

33
These notebooks introduce using spectral parameterization to developmental EEG data, using R.
44

@@ -17,3 +17,13 @@ This file applies spectral parameterization to a group of power spectra.
1717
### 04-R_ExampleAnalysis
1818

1919
This file does an example analysis of developmental EEG data with spectral parameterization.
20+
21+
22+
## Setting up Python in R Studio
23+
The installation instructions provide here correspond to the *01-R_PythonSetup.Rmd* script, and use the [reticulate](https://rstudio.github.io/reticulate/) package and [Miniconda](https://docs.conda.io/en/latest/miniconda.html) to access Python in R Studio.
24+
25+
Install and load the *reticulate* package and *Miniconda*. For novice Python users, we recommend installing Miniconda—a small version of anaconda that includes conda, Python, their dependencies, and common functions—via the `install_miniconda` function from the *reticulate* package. It is important to install *Miniconda* in a separate code chunk after the *reticulate* package has been loaded.
26+
27+
Identify and set the preferred Python version. We suggest using the `py_discover_config` and `conda_list` functions to identify all possible Python and conda version available, of which the newly installed *Miniconda* should be listed. After that, we recommend setting python from *Miniconda* as the preferred version, which can be done using the `edit_r_profile` function from the *usethis* package. Running `edit_r_profile()` will open a .Rprofile file in a new window where the path to the preferred python version can be set. To do so, change PATH in `Sys.setenv(RETICULATE_PYTHON = “PATH”)` to match the location where *Miniconda* is installed. This path information can be copied and pasted from the output of `conda_list(conda= "auto")`. The correct path will be listed next to the “r-reticulate” option. Save the edited .Rprofile file and restart R so that the changes take effect.
28+
29+
This procedure only needs to be executed once and will be saved for subsequent use. To ensure that the correct environment is being called, we recommend setting the `use_virtualenv` function to “r-reticulate”. The last step is to install python packages using the `py_install` function.

0 commit comments

Comments
 (0)