This is a repository of Dockerfile including packages and add-ins that are useful for writing articles with R Markdown in Rstudio. This Dockerfile is based on rocker/verse. Installing rstan conducted by the method described in antoine-sachet / rocker-ML.
Maintainer is Yoshihiko Kunisato (ykunisato@psy.senshu-u.ac.jp)
Keywords: psychology, cognitive science, rstudio, rstan, rmarkdown
-
Install "Docker Desktop"
-
Open "terminal"(Mac) or "Command Prompt"(Windows)
-
Type the following code to pull a Docker container. Change the "password" and "name_of_container" as you like.
Mac
docker run -e PASSWORD=password -p 8787:8787 -v $(pwd):/home/rstudio -d --name paperr ghcr.io/ykunisato/paper-r:latest-linux-arm64
or
docker run -e PASSWORD=password -e DISABLE_AUTH=true -p 8787:8787 -v $(pwd):/home/rstudio -d --name paperr ghcr.io/ykunisato/paper-r:latest-linux-arm64
Windows
docker run -e PASSWORD=password -p 8787:8787 -v "%cd%":/home/rstudio -d --name paperr ghcr.io/ykunisato/paper-r:latest-linux-arm64
-
Open the web browser and type "http://localhost:8787/" in the URL bar.
-
You will see the Rstudio on the web browser. Type rstudio in ID column and password that you set in password column.
In addition to the R packages, this image bundles tools that let you use AI assistants for coding and writing:
- R packages for LLMs:
ellmer(calling LLM APIs from R),ganderandchores(RStudio add-ins for AI-assisted coding),btw, andusethis.
To use these tools, set your own API key in ~/.Renviron.
-
In R, open the file with:
usethis::edit_r_environ()
-
Add a line with your key (here, Groq) and save:
GROQ_API_KEY="gsk_xxxxxxxxxxxx" -
Restart R.
This image's Rprofile.site is configured so that when GROQ_API_KEY is set, gander automatically uses Groq's llama-3.3-70b-versatile model:
if (nzchar(Sys.getenv("GROQ_API_KEY"))) {
options(
gander.chat = ellmer::chat_groq(
model = "llama-3.3-70b-versatile"
)
)
}To use a different model on Groq, change the model = "..." value. You can override the default per user (no rebuild needed) by adding the following to your own ~/.Rprofile (open it with usethis::edit_r_profile()), then restart R:
if (nzchar(Sys.getenv("GROQ_API_KEY"))) {
options(
gander.chat = ellmer::chat_groq(
model = "openai/gpt-oss-120b" # set to the model you want
)
)
}You can check the models currently available on Groq with:
curl https://api.groq.com/openai/v1/models -H "Authorization: Bearer $GROQ_API_KEY"or see the official list at console.groq.com/docs/models. Groq updates its lineup frequently, so check there for the latest and best-performing models.
To change the default for the whole image instead, edit the
Rprofile.siteblock in theDockerfileand rebuild.
To use a different provider altogether, set the corresponding API key (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY) and configure ellmer (chat_openai(), chat_anthropic(), etc.) accordingly.