From e5df50b1047e984dac102e262475793e3ad658a7 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Tue, 15 Oct 2024 15:43:25 +0100 Subject: [PATCH] Add rstudio subcommand docs --- docs/opensafely-cli.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/opensafely-cli.md b/docs/opensafely-cli.md index af7d53b02..68fadda77 100644 --- a/docs/opensafely-cli.md +++ b/docs/opensafely-cli.md @@ -195,6 +195,25 @@ opensafely exec IMAGE bash This can be useful if you want to explore the image manually. +### `rstudio` - Running rstudio-server + +To launch the OpenSAFELY r image running in a local instance of rstudio-server please navigate to your research repository and run + +```bash +opensafely rstudio +``` + +This will launch an rstudio-server session in a browser window, most likely at `http://localhost:8787/`. This provides the RStudio interface to the r image, therefore, the versions of R and all the packages are the same as they are in the r image. + +In your rstudio-server session you can work on your files as usual, including saving your edits. + +If you have an `.Rproj` file at the top level of your repository, `opensafely rstudio` will detect this and will open the rstudio-server session in RStudio's project mode. In this mode the Git pane is available, or you can make Git commits locally as you usually do. + +To end your rstudio-server session press ++ctrl+c++ in the Terminal window in which you ran the `opensafely run` command. + +An alternative method to open your project in rstudio-server is to open your research repository in [Codespaces](/getting-started/how-to/use-github-codespaces-in-your-project/#how-to-access-rstudio). + + ### `jupyter` - Running JupyterLab [Jupyter notebooks](https://jupyter.org/) are useful interactive