Looks like https://github.com/randy3k/radian/issues/219
Issue running code linebyline in vscode: Cannot determine RHOME
Describe the bug
Hi! I'm getting an error of Cannot determine R HOME
when trying to execute code linebyline 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
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": "UTF8",
// 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  vscodeR 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.
该提问来源于开源项目：Ikuyadeu/vscodeR
 点赞
 写回答
 关注问题
 收藏
 复制链接分享
 邀请回答
12条回答

采纳
点赞 评论 复制链接分享

采纳
ken Thanks  yes, setting
"r.alwaysUseActiveTerminal": false "r.bracketedPaste": false
Fixes the problem.
Why does this happen, though?
点赞 评论 复制链接分享 
采纳
Looks like you haven't changed any settings?
点赞 评论 复制链接分享 
采纳
Sorry I might have poorly grabbed the config. Biggest difference was that originally I had it set that I was NOT always using the active terminal and it didn't work.
Instead, when I set it to always use the active terminal, launched R from the vscode terminal, and then tweaked the brackets setting so no extra characters were being added it seems to work.
点赞 评论 复制链接分享 
采纳
With
"r.alwaysUseActiveTerminal": false
, when you pressctrl+enter
on an R document, it will runr.createRTerm
command to launch an R session automatically.In your settings,
"r.rterm.mac": "/Users/darya/anaconda3/bin/radian"
will make vscodeR launchradian
instead ofR
. It seems that you could successfully runradian
manually in VSCode terminal, but vscodeR cannot launchradian
but fails withCannot determine R HOME
? You could simply verify this by pressingF1
and runR: Create R terminal
command and it should produce the same error.点赞 评论 复制链接分享 
采纳
Yes, it does produce the same error. Any advice on how to fix it?
点赞 评论 复制链接分享 
采纳
Looks like something is missing in the environment variables to launch
radian
byR: Create R terminal
, something different from your zsh terminal in vscode. Not sure if this is a VSCodespecific problem?any idea on why this could happen?
点赞 评论 复制链接分享 
采纳
Where did you install R? It may be possible that you have a different PATH variable in VSCode. I recall that there is an option in VSCode to inherit the environment variables from the shell. You may want to check that out.
点赞 评论 复制链接分享 
采纳
Maybe you need to specify the following in your vscode settings?
json "terminal.integrated.env.osx": { "R_HOME": "..." }
点赞 评论 复制链接分享 
采纳
ken Specifying that in the VSCode settings did indeed solve the problem!
It does generate a warning of :
Warning message: requested TAR '/usr/bin/tar' does not exist; using 'internal' instead
But then libraries load and code executes.
I am curious, though, how to get it to properly
source("~/.Rprofile")
since I've got a few custom functions in that, and VSCode is clearly not picking them up...
点赞 评论 复制链接分享 
采纳
It looks like some important environment variables are missing when vscodeR launches
radian
viawindow.createTerminal(termOptions)
. I guess we should use what https://github.com/ManuelHentschel/VSCodeRDebugger/blob/master/src/installRPackage.ts#L26 does: sending R terminal command to the shell in vscode terminal so that the environment variables from the shell (e.g. zsh) could be inherited.点赞 评论 复制链接分享 
采纳
You might try installing the vsix from https://github.com/renkunken/vscodeR/actions/runs/334838489 and see if it works now.
点赞 评论 复制链接分享
相关推荐
 回答 1 已采纳 I was playing and learning with the beego framework for go, but my hello world example didn't run and from what I determine is that beego does a chdir based on os.Args[0] and that the program is run there. And that is why the app runs, but can't find the views directory. So backtracking to a simpler level, filename 'example.go': package main import ( "fmt" "os" ) func main() { fmt.Println(os.Getwd()) fmt.Println(os.Args[0]) } Will output: /<directory 'go run this_file.go' was run in>/ <nil> /tmp/gobuild178877254/commandlinearguments/_obj/exe/example I don't understand enough about go as why this the way it is. My first thought is that I'm using gvm (go version manager) and this is happening because something is off. Any help appreciated. EDIT: Apparently, go build ./example produces a better, expected, and successful outcome: <directory './example' was run in>/ <nil> <directory './example' was run in>/
 回答 1 已采纳 Problem Description A deranged algorithms professor has devised a terrible final exam: he throws his students into a strange maze formed entirely of linear and circular paths, with line segment endpoints and object intersections forming the junctions of the maze. The professor gives his students a map of the maze and a fixed amount of time to find the exit before he floods the maze with xerobiton particles, causing anyone still in the maze to be immediately inverted at the quantum level. Students who escape pass the course; those who don't are trapped forever in a parallel universe where the grass is blue and the sky is green. The entrance and the exit are always at a junction as defined above. Knowing that clever ACM programming students will always follow the shortest possible path between two junctions, he chooses the entrance and exit junctions so that the distance that they have to travel is as far as possible. That is, he examines all pairs of junctions that have a path between them, and selects a pair of junctions whose shortest path distance is the longest possible for the maze (which he rebuilds every semester, of course, as the motivation to cheat on this exam is very high). The joy he derives from quantumly inverting the majority of his students is marred by the tedium of computing the length of the longest of the shortest paths (he needs this to know to decide how much time to put on the clock), so he wants you to write a program to do it for him. He already has a program that generates the mazes, essentially just a random collection of line segments and circles. Your job is to take that collection of line segments and circles, determine the shortest paths between all the distinct pairs of junctions, and report the length of the longest one. The input to your program is the output of the program that generates his mazes. That program was written by another student, much like yourself, and it meets a few of the professor's specifications: 1) No endpoint of a line segment will lie on a circle; 2)No line segment will intersect a circle at a tangent; 3) If two circles intersect, they intersect at exactly two distinct points; 4)Every maze contains at least two junctions; that is, a minimum maze is either a single line segment, or two circles that intersect. There is, however, one bug in the program. (He would like to have it fixed, but unfortunately the student who wrote the code never gave him the source, and is now forever trapped in a parallel universe.) That bug is that the maze is not always entirely connected. There might be line segments or circles, or both, off by themselves that intersect nothing, or even little "submazes" composed of intersecting line segments and circles that as a whole are not connected to the rest of the maze. The professor insists that your solution account for this! The length that you report must be for a path between connected junctions! Example: 1.2. 3.4. Detail Description: Pictrue 1: Line segments only. The large dots are the junction pair whose shortest path is the longest possible. Pictrue 2: An example using circles only. Note that in this case there is also another pair of junctions with the same length longest possible shortest path. Pictrue 3: Disconnected components. Pictrue 4: Now the line segments are connected by a circle, allowing for a longer shortest path. Input An input test case is a collection of line segments and circles. A line segment is specified as "L X1 Y1 X2 Y2" where "L" is a literal character, and (X1,Y1) and (X2,Y2) are the line segment endpoints. A circle is specified by "C X Y R" where "C" is a literal character, (X,Y) is the center of the circle, and R is its radius. All input values are integers, and line segment and circle objects are entirely contained in the first quadrant within the box defined by (0,0) at the lower left and (100,100) at the upper right. Each test case will consist of from 1 to 20 objects, terminated by a line containing only a single asterisk. Following the final test case, a line containing only a single asterisk marks the end of the input. Output For each input maze, output "Case N: ", where N is the input case number starting at one (1), followed by the length, rounded to one decimal, of the longest possible shortest path between a pair of connected junctions. Sample Input L 10 0 50 40 L 10 4 0 50 0 L 10 1 0 60 1 0 L 0 30 50 30 * C 25 2 5 25 C 50 2 5 25 C 25 5 0 25 C 50 5 0 25 * L 0 0 80 80 L 80 1 00 100 80 * L 0 0 80 80 L 80 1 00 100 80 C 85 8 5 10 * * Sample Output Ca se 1: 68.3 Ca se 2: 78.5 Ca se 3: 113.1 Ca se 4: 140.8
 回答 2 已采纳 Problem Description There are some chickens and rabbits in the cage. They have fifteen heads and forty feet in all. How many chickens and rabbits are there respectively? It is a classical math problem which can date back to the Northern and Southern Dynasties (420589). Here is an interesting algorithm to solve the problem: Assume that the chickens and rabbits are well trained. You whistle, and all of them lift a leg, then there are 4015 = 25 feet on the floor. You whistle again, and there are 25  15 = 10 legs remain standing. After two whistles, all the chickens sit on the floor, and all the rabbits stand on two legs. So there are 10/2 = 5 rabbits and 15  5 = 10 chickens. John has a farm with lots of animals in it. He is now facing the similar problem. There are exactly N kinds of animals and he wants to know their quantities. He only knows that different kinds of animals have different number of legs (at least one), but he has no idea how many legs they each have. He trains the animals and tries to figure it out using the algorithm stated above. First he makes all the animals stand up with all their legs and counts their legs. then, for each time he whistles, all the animals lift one leg(if it has at least one leg standing on the ground), and then he counts the feet again. After K times, he thinks that it is enough to determine the quantity of each kind of animal, but does it really work? So, it is your job to help him to solve the problem. Input The first line contains an integer T(1 <= T <= 100), indicating the number of test cases. Each test case contains two lines. The first line contains two integers N(1 <= N <= 1000) and K(1 <= K <= 1000), representing the number of different kinds of animals and the time he whistles. The second line contains K + 1 integers A0,A1 ... AK(0 <= Ai <= 104) where Ai represents the number of legs after his ith whistle. Output For each test case in the input, print several lines. The first line contains "Case #X:", where X is the test case number (starting with 1). The next line contains "No Solution", "Unique Solution" or "Multiple Solutions" according to the result. If the result is uniquely determined, you should print N extra lines each contains two integer Li,Ni, where Li represents how many legs does the ith kind of animal have and Ni represents the number of ith kind of animal. The animals should be sorted by the number of their legs in ascending order. Sample Input 3 2 3 14 9 6 3 2 2 8 5 3 3 2 20 13 8 Sample Output Case #1: Unique Solution 1 2 4 3 Case #2: No Solution Case #3: Multiple Solutions
 回答 1 已采纳 Description Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple. Whenever some ACM member has any small money, he takes all the coins and throws them into a piggybank. You know that this process is irreversible, the coins cannot be removed without breaking the pig. After a sufficiently long time, there should be enough cash in the piggybank to pay everything that needs to be paid. But there is a big problem with piggybanks. It is not possible to determine how much money is inside. So we might break the pig into pieces only to find out that there is not enough money. Clearly, we want to avoid this unpleasant situation. The only possibility is to weigh the piggybank and try to guess how many coins are inside. Assume that we are able to determine the weight of the pig exactly and that we know the weights of all coins of a given currency. Then there is some minimum amount of money in the piggybank that we can guarantee. Your task is to find out this worst case and determine the minimum amount of cash inside the piggybank. We need your help. No more prematurely broken pigs! Input The input consists of T test cases. The number of them (T) is given on the first line of the input file. Each test case begins with a line containing two integers E and F. They indicate the weight of an empty pig and of the pig filled with coins. Both weights are given in grams. No pig will weigh more than 10 kg, that means 1 <= E <= F <= 10000. On the second line of each test case, there is an integer number N (1 <= N <= 500) that gives the number of various coins used in the given currency. Following this are exactly N lines, each specifying one coin type. These lines contain two integers each, Pand W (1 <= P <= 50000, 1 <= W <=10000). P is the value of the coin in monetary units, W is it's weight in grams. Output Print exactly one line of output for each test case. The line must contain the sentence "The minimum amount of money in the piggybank is X." where X is the minimum amount of money that can be achieved using coins with the given total weight. If the weight cannot be reached exactly, print a line "This is impossible.". Sample Input 3 10 110 2 1 1 30 50 10 110 2 1 1 50 30 1 6 2 10 3 20 4 Sample Output The minimum amount of money in the piggybank is 60. The minimum amount of money in the piggybank is 100. This is impossible.
 回答 1 已采纳 I am trying to debug Go 1.4 using IntelliJ Idea 14.0.2 and the current golangideaplugin alpha 0.9.16dev0.9.16alpha.9 from http://githubintellijplugin.appspot.com/golangpluginorg/golangideaplugin/alpha.xml . As mentioned in https://github.com/golangpluginorg/golangideaplugin/pull/588 this should work. The plugin is working fine for running "Hello world", but my "Debug"Button is greyed out. I already updated gdb to version 6.8.1, versions 6.8 and 6.7.7 did not work either. This is my debug configuration : What am I missing? Do I need a specific gdb version or is the problem somewhere else? Or is it because I am using Go 1.4?
 dream21st的博客 1，错误日志 org.springframework.dao.DataIntegrityViolationException: Error attempting to get column 'name' from ... Cause: java.sql.SQLDataException: Cannot determine value type from string '...
 AI 菌的博客 1. 问题处理 当我们更换镜像源进行pip 安装时，可能会出现报错：ERROR: Cannot determine archive format of ：XXXXXXXXXX 比如我刚开始安装tf2.0： pip install i ... 2.... 更多问题请参考 清华镜像快速安装各种python...
 艾斯这个小卷毛的博客 SQLDataException: Cannot determine value type from string 初学Mybatis+Spring，本来想列出全部记录，返回一个list，但是报错了 这个异常我的理解就是字段和类型对不上，检查很多遍还是没找到问题，看了很多...
 littleliense的博客 Mac IDEA启动项目报错： Error:build: Cannot determine build data storage root for project 原因分析： mac环境创建新的文件夹使用git拉取项目导入IDEA时，启动项目报错 Error:build: Cannot determine build ...
 roy8666的博客 使用以下命令安装成功 pip install i https://pypi.tuna.tsinghua.edu.cn/simple trustedhost pypi.tuna.tsinghua.edu.cn 模块名
 白面小生的博客 idea启动springboot项目报：Cannot determine build data storage root for project 翻译：无法确定项目的生成数据存储根 其实就是 你对这个文件夹（项目目录）没有权限，往下看 操作指南： 选中你的项目 右键...
 排骨瘦肉丁的博客 用Mybatis查询的时候出现如下错误： Resolved [org.springframework.dao.DataIntegrityViolationException: Error attempting to get column 'person_name' ... Cause: java.sql.SQLDataException: Cannot determin...
 wide288的博客 使用go mod的方法 ...go: cannot determine module path for source directory E:\tttttt (outside GOPATH, no import comments) 1.在src 目录下新建 go.mod文件 2. go.mod中第一行加入一行内容 module ...
 看或不看bug都在那里的博客 解决方法如下： ...go: cannot determine module path for source directory xxxxxxx\example (outside GOPATH, no import comments) // 加上module名example xxxxxxx\example>go mod ...
 ERROR in : Cannot determine the module for class ManageDataComponent in D:/softDoc/javaweb_serve/hjp3年前xiaoqie159的博客 ERROR in : Cannot determine the module for class ManageDataComponent in D:/softDoc/javaweb_serve/hjpt_front_svn/src/app/cnicapp/content/manageIcp/manage data/managedata.component.ts! Add Man...
 横云断岭的博客 写在前面这个demo来说明怎么...调试排查 Cannot determine embedded database driver class for database type NONE 的错误把工程导入IDE里，直接启动应用，抛出来的异常信息是： Error starting ApplicationContext. T
 simmel_的博客 环境：Overleaf 模板：ACM Conference Template \documentclass[sigconf]{acmart} \usepackage{booktabs} ...问题：插入图片，报错“Cannot determine size of graphic in storageModel.pdf (no BoundingBox).”...
 askmaggie的博客 conda安装tensorflow的时候，pip install tensorflowgpu超级慢，慢到需要1day，直到报错timeout。 找到清华源：... 实际使用后，仍然有错： ...That's odd. It is even odd that I cannot find a s...
 gao_grace的博客 今天spring boot使用redis的时候，发生了如下的错误：io.lettuce.core.cluster.PartitionSelectorException: Cannot determine a partition to read for slot xxx. 上网查找说可能是node被删除了，但是slot没有重新...
 2年前大哥的叔的博客 错误： org.apache.ibatis.exceptions.PersistenceException: ### Error querying ... Cause: java.sql.SQLDataException: Cannot determine value type from string 'id' ### The error may exist in mybatis...