Linux 服务器上的 R 管道工 [英] R plumber on Linux Server

查看:24
本文介绍了Linux 服务器上的 R 管道工的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用管道工代码制作了一个 .R 文件.该文件在我的本地电脑上运行良好,在我的 linux 服务器上也运行良好.我现在唯一的问题是,它只是本地的.

I've made a .R file with a plumber code. The file works fine on my local pc, it works also fine on my linux server. My only problem now is, that it's only local.

我需要能够通过服务器地址获取 API.服务器还运行一个 cronR 进程,它使所有的数学和一个闪亮的应用程序显示一些图表.所有数学运算都存储在一个 cvs 文件中,管道工现在应该获取最后一个索引并显示它,以便我可以在任何地方使用它.

I need to be able to get the API over the server adress. The server also runs a cronR process which makes all the math and a shiny-app to display some graphs. All the math is stored into an cvs file and plumber should now get the last index and display this so I can use it from everywhere.

有什么解决办法吗?

代码:

library(plumber)

path = "/srv/shiny-server/Crypto10/data/"

r = plumb(paste(path,"API.R", sep = ""))  

r$run(port=8000)

推荐答案

try

r$run(host="0.0.0.0",port=8000)

这篇关于Linux 服务器上的 R 管道工的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆