Test R app via openCPU localy

戏子无情 提交于 2019-12-13 00:33:52

问题


I wrote an R package and now I want to provide let's say a small demo fronted as a webapplication. For this I already wrote a index.html file which I saved to the <pkgRoot>/inst/www/ folder. I also installed the opencpu package which works fine wehen I use it via the localhost:<portNum>/ocpu/test/ "Interface", where I already can see my Package and use the Ajax POST and GET requests in order to see the package is doing what it's ment to do.

But now im stuck in a sense that I do not know how to test my own app (index.html) localy. localhost:<portNum>/ocpu/<pkgName>/www/index.html does not work. As I understood it, the opencpu Comes with the Apache 2 and hence ist not neccessary to set up an additional webserver? When I check the path to the installed package the www folder as well as the index.html seem to be exactly were they should be, as far as I understand it.

Do i somehow have to install the app via the

opencpu::install_apps("pkgName")

inside R? Becaue if I try to do this, it seems there is no way to install local apps but only apps hosted at github. .... and I just want to test the app localy!

Realy happy for any suggestions


回答1:


Just use

opencpu::ocpu_start_app("pkgName")

That should start an HTTP server in R and launch your browser.



来源:https://stackoverflow.com/questions/50968474/test-r-app-via-opencpu-localy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!