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.

Issue running code line-by-line in vscode: Cannot determine RHOME

See original GitHub issue

Describe the bug Hi! I’m getting an error of Cannot determine R HOME when trying to execute code line-by-line in VSCode. This is a new problem which hadn’t happened to me before, so I think an update might have broken some settings in some weird and wonderful way?

To Reproduce Steps to reproduce the behavior:

  1. Open a random R script
  2. command + enter on the first line (which happens to say library(tidyverse) but this is irrelevant)

Do you want to fix by self?

I wish I could

(If yes,) what kind of help do you want? (e.g. Which file should I fix, Survey (related documents)

(If related)setting.json


// R path for Mac OS X
"r.rterm.mac": "/Users/darya/anaconda3/bin/radian"

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

// 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": false,

// 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,

Expected behavior I was hoping the code would run line by line…

Environment (please complete the following information):

  • OS: macOS 10.15.7 (19H2)
  • VSCode Version: Version: 1.50.1
  • R Version: 4.0.2
  • vscode-R version: v1.5.1

Additional context

Running /Users/darya/anaconda3/bin/radian (or radian) from the zsh command line results in R happily launching, and the library(tidyverse) code working without errors (as does running the script from RStudio)

What’s wrong with my Config? Thanks in advance!

PS I have seen the issue here - but can’t seem to fix the R RHOME issue by using the tips there.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
renkun-kencommented, Oct 28, 2020

@dvanic Maybe you need to specify the following in your vscode settings?

"terminal.integrated.env.osx": {
  "R_HOME": "..."
}
0reactions
github-actions[bot]commented, Jun 16, 2022

This issue was closed because it has been inactive for 14 days since being marked as stale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vscode could not open radian (Linux, Manjaro) - Stack Overflow
Across to read github page, I find a way to solve it. I add a option in my vscode settings. "r.rterm.option": ["--r-binary=/home/ ...
Read more >
Debugging in Visual Studio Code
Pause: Inspect code executing at the current line and debug line-by-line. ... When a debugging session starts, breakpoints that cannot be registered with ......
Read more >
Advanced Visual Studio Code for Python Developers
It can be a powerful tool for rapid Python development. In this tutorial, you'll learn how to: Customize your user interface; Run and...
Read more >
How to use LaTeX on VS Code? - TeX
I Installed LaTeX Workshop through VSC, but I can't see any preview. For my LaTeX Compiler output, I get latexmk: The script engine...
Read more >
How To Run Selected Lines In VS Code (Visual Studio Code)
I found being able to run my script either line by line, or by code blocks, really help me debug my Python code...
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