From 80acecc91a5c7595526bca2361911d73d269c1d5 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Mon, 6 Jan 2025 21:42:16 +0000 Subject: [PATCH] Improve R install docs (#22737) Release Notes: - N/A --- docs/src/languages/r.md | 45 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/docs/src/languages/r.md b/docs/src/languages/r.md index 934df61e597d57..472f84da1feb83 100644 --- a/docs/src/languages/r.md +++ b/docs/src/languages/r.md @@ -7,15 +7,54 @@ R support is available through the [R extension](https://github.com/ocsmit/zed-r ## Installation -- [Install R](https://cloud.r-project.org/) -- Install the R packages `languageserver` and `lintr`: +1. [Download and Install R](https://cloud.r-project.org/). +2. Install the R packages `languageserver` and `lintr`: ```R install.packages("languageserver") install.packages("lintr") ``` -- Install the [R extension](https://github.com/ocsmit/zed-r) through Zed's extensions +3. Install the [R Zed extension](https://github.com/ocsmit/zed-r) through Zed's extensions manager. + +For example on macOS: + +```sh +brew install --cask r +Rscript --version +Rscript -e 'options(repos = "https://cran.rstudio.com/"); install.packages("languageserver")' +Rscript -e 'options(repos = "https://cran.rstudio.com/"); install.packages("lintr")' +Rscript -e 'packageVersion("languageserver")' +Rscript -e 'packageVersion("lintr")' +``` + +## Ark Installation + +To use the Zed REPL with R you need to install [Ark](https://github.com/posit-dev/ark), an R Kernel for Jupyter applications. +You can down the latest version from the [Ark GitHub Releases](https://github.com/posit-dev/ark/releases) and then extract the `ark` binary to a directory in your `PATH`. + +For example to install the latest non-debug build: + +```sh +# macOS +cd /tmp +curl -L -o ark-latest-darwin.zip \ + $(curl -s "https://api.github.com/repos/posit-dev/ark/releases/latest" | \ + jq -r '.assets[] | select(.name | contains("darwin-universal") and (contains("debug") | not)) | .browser_download_url') +unzip ark-latest-darwin.zip ark +sudo mv /tmp/ark /usr/local/bin/ +``` + +```sh +# Linux X86_64 +cd /tmp +curl -L -o ark-latest-linux.zip \ + $(curl -s "https://api.github.com/repos/posit-dev/ark/releases/latest" \ + | jq -r '.assets[] | select(.name | contains("linux-x64") and (contains("debug") | not)) | .browser_download_url' + ) +unzip ark-latest-linux.zip ark +sudo mv /tmp/ark /usr/local/bin/ +```