[英]What does “Error in tools:::httpdPort <= 0L : …” in Rstudio means?
I have upgraded R to version 3.2.2. 我已将R升级到版本3.2.2。 When I restart Rstudio, before ">" is shown, there is an error message:
当我重新启动Rstudio时,在显示“>”之前,会出现一条错误消息:
Error in tools:::httpdPort <= 0L :
comparison (4) is possible only for atomic and list types
What does this mean? 这是什么意思? What should I do to remove this message?
我该怎么做才能删除此邮件?
Upgrade your RStudio version to the latest one, should work in any OS. 将您的RStudio版本升级到最新版本,应该适用于任何操作系统。
For Linux/Ubuntu 14.04 terminal users, simply do: 对于Linux / Ubuntu 14.04终端用户,只需执行以下操作:
sudo apt-get remove rstudio
wget https://download1.rstudio.org/rstudio-0.99.489-amd64.deb
sudo dpkg -i rstudio-0.99.489-amd64.deb
Now, run RStudio. 现在,运行RStudio。 The error message should disappear.
错误消息应该消失。
I just encountered the same problem today and searched through the source code to understand the origin. 我今天刚遇到同样的问题,并通过源代码搜索了解原点。 The reason is that until R 3.1.3,
httpdPort
was a variable, while since R 3.2.0, it is a function. 原因是直到R 3.1.3,
httpdPort
是一个变量,而自R 3.2.0起,它就是一个函数。
The error occurs, because the line 发生错误,因为该行
tools:::httpdPort <= 0L
is wrong, if httpdPort
is a function. 如果
httpdPort
是一个函数,那就错了。 It should rather be 它应该是
tools:::httpdPort() <= 0L
It seems that RStudio runs that line at some point and of course, it needs to know, which of the two versions to run. 似乎RStudio在某些时候运行该行,当然,它需要知道,运行两个版本中的哪一个。 This is why RStudio needs to be updated after R is updated from a version <= 3.1.3 to a version >= 3.2.0.
这就是在R从版本<= 3.1.3更新到版本> = 3.2.0之后需要更新RStudio的原因。
The httpdPort
is defined in the file src/library/tools/R/dynamicHelp.R
. httpdPort
在文件src/library/tools/R/dynamicHelp.R
。 In R version 3.1.3, the definition reads 在R 3.1.3版中,定义为
httpdPort <- 0L
while in R version 3.2.0, it is 在R版本3.2.0中,它是
httpdPort <- local({
port <- 0L
function(new) {
if(!missing(new))
port <<- new
else
port
}
})
To solution to the problem is thus to either downgrade your R version to <= 3.1.3 or to upgrade RStudio. 因此,解决问题的方法是将R版本降级为<= 3.1.3 或升级RStudio。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.