Publish Rstudio Shiny App in intranet - r

I am trying to build a Rstudio/Shiny App and post it in our intranet so that everyone else in our office could see it. I am a windows guy, and the instructions online about how to setup a shiny server within Linux environment is a bit difficult for me. Is there an easy way that I can could accomplish this goal without messing up with Linux. Even if I have to do so, is there an easy way to just have my webpage available to people within our company, not everyone on the internet. Thanks!

you don't need shiny server for this, you just need to run an R instance with shiny
http://rstudio.github.io/shiny/tutorial/#ui-and-server
http://shiny.rstudio.com/
shiny automatically runs it at local host...
you need to change it to your own ip if you want your colleges be able to access it..
ip="192.168.178.10" # change this!
runApp("../microplate",host=ip) # change microplate to the name of your shiny package/app

RStudio also has a hosted Shiny option that is currently in Alpha. You can sign up here https://www.shinyapps.io/admin/#/signup
With hosted Shiny the intention is to let developers focus on building applications while RStudio will worry about managing servers, monitoring performance, and ensuring uptime.

I am sharing apps using the following:
runApp(list(ui=ui, server=server), host="0.0.0.0", port=1234)
(if your ui.R and server.R are in the same file)
runApp("C:/shinyapp", host="0.0.0.0", port=1234)
(if you have an ui.R and a server.R files as 2 files in the shinyapp folder)
After, I send my IP followed by the port that I set up as an hyperlink. Assuming that my IP is 192.168.178.10, I will send:
http://192.168.178.10:1234
Monitoring a shiny app shared in my internal network

Related

Put RShiny app in docker for Windows based local computers

I have an RShiny based application developed on Windows 10 using R (4.0.4), RStudio and RShiny. I want to share this application with my colleagues (who also use Windows 10) for them to use but they don't have R or RStudio installed. I want them to be able to use this app without installing R and RStudio since we don't have admin rights on our laptops and getting them requires raising tickets. One possible option would be to host the app on a server and use shiny-server, then share the link to the app. But we don't have a server budget currently.
My primary question is, if there is a way to share the app with my colleagues without them having to go through the hassle of installing R and RStudio.
From my preliminary research, I have found that Dockers (or Rockers by RStudio Inc.) can be used to achieve this by making the app into a "docker image" (whatever this means!). But all the articles I found were about dockerising the RShiny app for Linux based systems and servers. Hence, my secondary question is, if anybody knows this Docker/Rocker can be used on Windows based systems to help me in my scenario explained in first paragraph.

Lock FlexDashboard Markdown for edits

I am trying to find a way to make a FlexDashboard (using Shiny runtime) accessible to a colleague without access to the internet.
To provide my colleague with the full interactive experience (drop-down menus etc), I was thinking of simply installing R on my colleagues laptop and share the markdown script with them but does anyone know a way to lock the script for edits?
I just want to make sure that there is no accidental edits which might mess up the running of the markdown.
Look forward to hearing any inputs!
I would create a shiny application tweak it perfectly and then write a docker script to run they shiny application as an independent entity,
Your friend can use that docker container to run the dashboard and interact with it, but has no need of opening the script or anything else, just bake all the functionality into the shiny application and call the docker container and the flexdashboard will publish to a console.

R - Shiny App : How to host a Shiny App without interruption? If possible on Github or Shiny Server

So my shiny app goes to sleep since it is running locally on my computer, I want people to be able to access it even when my computer is turned off, i.e I want it to be hosted somewhere online so that it can continuously run. Any help would be great

Shiny app on Server: not publish it, only make it run

I am working on an Shiny app in R. My goal is to put in on a server, not on my local pc.
EDIT: my goal is not to publish it on the web, but only make it run on the server locally.
I have installed R on the server, added all the libraries I need, lastly I tried to launch my app that it is quite long, the schema is more or less this:
data preprocessing (with RODBC)
some custom functions
server<- etc.
ui<- etc.
shinyapp(server,ui)
Well in my local pc everything is fine, but on the server I cannot have a result, it is impossible to reach the address.
I decided to do something like this, create the two files called server and ui, and launching them with:
runApp(".../shiny")
Having the idea to use the option of runApp.
Well it is arriving this
ERROR: Error sourcing C:\Users\...\AppData\Local\Temp\Rtmp8YeSOV\file22281c0c2f6d
First of all, this procedure is going to help me?
If so, could you tell me what that error mean?
Thanks in advance.
I'm not sure, but I think it's not possible to reach a shiny app running in a local computer (or server). For that purpose you can use the Shiny Sever, which allow you to put your Shiny apps accessible online.
It seems that your server is a Windows computer, so your options are:
Build Shiny Server from its source code, (maybe a little difficult).
Use a virtual machine like VMware Player (free for non-commercial use) and install Ubuntu or other Linux distribution to use the pre-built binary of Shiny Server. With this option you can restrict the access to only your local network and maybe faster access to your DB's.
Use a DigitalOcean virtual server (for a very reasonable price), in this case you apps will be on the cloud and accesible everywhere.
For option 2 and 3 you can follow the very useful and well written tutorial of Dean Attali about installing and setting up a Shiny Sever. It is for DigitalOcean but is pretty much the same if you decide to use a virtual machine with Linux.
The answer is quite simple, I was using IE as browser: if you use Chrome specifying it on the runApp statement, everything works fine.

R- Shiny webserver on a local server

I have a windows machine with IIS and I can see the IIS welcome page on http://myname/. I have recently started using Shiny through its own server and I can see shiny apps on http://127.0.0.1:port
Now my question is how can I allow others to see my shiny apps on http://myname:port ? (since 127.0.0.1 is not accessible from other computers). Is this possible with the free version of shiny?
You should make following:
Find your IP ("ipconfig" from cmd prompt in Windows)
Set Shiny to start from port "XXXX" and your IP (instead of 127.0.0.1)
For example:
options(shiny.port = 7775)
options(shiny.host = "192.0.0.45")
Run your App
runApp(app)
Make sure the port is opened in your firewall.
To be a bit more precise, this is how your file startApp.R might look like:
library(shiny)
options(shiny.host = '0.0.0.0')
options(shiny.port = 8888)
runApp('shinyapp')
This is an example of how you would set the options if Shiny was running behind nginx with tcp.
The comments have already said this, but in the interest of providing an answer:
You can use shiny server (free and pro) to host apps on your own server. I believe this will allow you to set it up on http://myname/, however shiny server should be running in a linux environment as listed by #pops.
https://www.rstudio.com/products/shiny/shiny-server/
Or
you can use shiny.io to host them for you, with premium versions having the ability to set your own domain
https://www.shinyapps.io/
When using Shiny localy the library set a server in which you can access the Shiny application. If you want to make it accesible on a LAN you have to set up a Shiny server.
You will need a Linux server with R and Shiny instaled, in addition to all the libraries your application needs. To configure it you can follow this
Once the server is totally configured you can add your own applications to the server adding the applications to the folder:
/srv/Shiny-server/myApp
And will be available inyourServerAddress:3838/myApp

Resources