连接远程R服务器|未来套餐

时间:2018-08-16 18:14:07

标签: r ubuntu virtualbox future remote-server

我知道我丢失了一些东西,但是无法弄清楚。我有一个运行R的虚拟ubuntu服务器,可以执行一些远程计算。我正在使用“ future”程序包执行此过程,并且在运行代码时将其连接时遇到一些问题。

我还在ubuntu服务器上安装了Rstudio,当我在Web浏览器中调用它时| http://127.0.0.1:8787 |工作正常。

运行代码时,出现以下错误:

Error in socketConnection("localhost", port = port, server = TRUE, blocking = TRUE,  : 
  reached elapsed time limit

。 -------------------------

library("plotly")
library("future")
library("microbenchmark")

#Virtual ubuntu ip: 10.0.2.15


#remote_ip <- "127.0.0.1:8787"
#remote_ip <- "10,0.2.15:22"
remote_ip <- "10.0.2.15:8787"

## %<-% assignments will be resolved remotely
plan(remote, workers = remote_ip)

## Set up data (locally)
set.seed(100)
d <- diamonds[sample(nrow(diamonds), 1000), ]

## Generate ggplot2 graphics and plotly-fy (remotely)
gg %<-% {
p <- ggplot(data = d, aes(x = carat, y = price)) +
  geom_point(aes(text = paste("Clarity:", clarity)), size = 4) +
  geom_smooth(aes(colour = cut, fill = cut)) + facet_wrap(~ cut)
ggplotly(p)
}

## Display graphics in browser (locally)
gg <- microbenchmark(gg)
gg

1 个答案:

答案 0 :(得分:0)

我发现这篇文章解决了大部分问题。我仍然无法连接运行R的远程服务器。目标是卸载处理代码。

https://jaehyeon-kim.github.io/2015/11/Connecting-to-VirtualBox-Guest-via-SSH-And-RStudio-Server.html