简体   繁体   中英

What does “Error in tools:::httpdPort <= 0L : …” in Rstudio means?

I have upgraded R to version 3.2.2. When I restart Rstudio, before ">" is shown, there is an error message:

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.

For Linux/Ubuntu 14.04 terminal users, simply do:

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. 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.

The error occurs, because the line

tools:::httpdPort <= 0L

is wrong, if httpdPort is a function. 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. This is why RStudio needs to be updated after R is updated from a version <= 3.1.3 to a version >= 3.2.0.

The httpdPort is defined in the file src/library/tools/R/dynamicHelp.R . In R version 3.1.3, the definition reads

httpdPort <- 0L

while in R version 3.2.0, it is

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM