Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RStudio : Rook does not work?

I would like to build a simple webserver using Rook, however I am having strange errors when trying it in R-Studio:

The code

library(Rook)
s <- Rhttpd$new()
s$start()
print(s)

returns the rather useless error

"Error in listenPort > 0 : comparison (6) is possible only for atomic and list types".

When trying the same code in a simple R-Console,everything works - so I would like to understand why that happens and how I can fix it.

RStudio is Version 0.99.484 and R is R 3.2.2

like image 665
Christian Sauer Avatar asked Sep 29 '15 10:09

Christian Sauer


1 Answers

I've experienced same thing.

TLDR: This pull request solves the problem: https://github.com/jeffreyhorner/Rook/pull/31


RStudio is treated in different way and Rook port is same as tools:::httpdPort value. The problem is that in current Rook master tools:::httpdPort is assigned directly. It's a function that's why we need to evaluate it first.


If you want to have it solved right now, without waiting for merge into master: install devtools and load package from my fork @github.

install.packages("devtools")
library(devtools)
install_github("filipstachura/Rook")
like image 152
Filip Avatar answered Sep 23 '22 14:09

Filip