question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interactive R terminal using system default R instead of R in a conda environment

See original GitHub issue
  • VSCode Version: 1.52.1
  • VSCode-R Version: 1.6.3
  • OS Version: macOS catalina 10.15.6

Steps to Reproduce:

  1. R: Create R Terminal
  2. The R interactive terminal uses a system default R(3.4.4), and I have created a conda environment and installed another R(4.0.3) before, how can I switch to the version 4.0.3 in vscode? Thanks!

Do you want to fix by self? (I hope your help!)

No

(If related)setting.json

// R path for Linux
"r.rterm.linux": "/mnt/Storage/home/xx/miniconda3/envs/tools/bin/radian“,

// R command line options (i.e: --vanilla)
"r.rterm.option": [--no-save --no-restore],

// An optional encoding to pass to R when executing the file, i.e. 'source(FILE, encoding=ENCODING)'
"r.source.encoding": "UTF-8",

// Keeping focus when running
"r.source.focus": "editor",

// Use active terminal for all commands, rather than creating a new R terminal
"r.alwaysUseActiveTerminal": true,

// Use bracketed paste mode
"r.bracketedPaste": true,

// Enable R session watcher (experimental)
"r.sessionWatcher": true,

// Delay in milliseconds before sending each line to rterm (only applies if r.bracketedPaste is false)
"r.rtermSendDelay": 8,

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ManuelHentschelcommented, Jan 27, 2021
// Use active terminal for all commands, rather than creating a new R terminal
"r.alwaysUseActiveTerminal": true,

This setting is used to send code (e.g. form pressing ctrl+enter) directly to the currently active terminal. If you open the R session yourself (as described in your most recent comment) the setting in r.rterm.linux shouldn’t have any effect here. To create an R terminal using the path specified in the extension setting, you can call R: create R terminal or set r.alwaysUseActiveTerminal to false.

To see what’s going on could you please

  • Open an R session as you usually do and type sessionInfo() to check the R version
  • Open an R session using R: create R terminal and check the R version
  • Open a bash console, paste the path from r.rterm.linux, and check the R version
1reaction
pfren1998commented, Jan 27, 2021

There are several steps for me to run my code in R

open bash terminal in vscode
type `conda activate tools` in bash console
type `R` in bash console
select R code and command + enter (send code to the R terminal in remote server)

I wonder if there are some problems with my operation Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using R in Conda - Biostar
Use conda create -n R to create new environment. Always install r-essentials package rather than conventional r-base to prevent yourself from the horrors...
Read more >
Using R language with Anaconda
R is the default interpreter installed into new environments. You can specify the R interpreter with the r-base package. Unless you change the...
Read more >
Using R on the HPC Clusters | Princeton Research Computing
This page shows how to install R packages and run R scripts on the Princeton HPC clusters. RStudio can be used in your...
Read more >
R packages won't install on conda R environment
1 Answer 1 · open your terminal and connect to the HPC server. · activate your conda environment using conda activate r_env ·...
Read more >
Using R in Visual Studio Code with conda environment
A simple alternative that works for me is to 1) open a terminal in vscode, 2) activate the conda environment there, 3) open...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found