R aplication without internet - r

I want to develop an aplication with witch it creates a file with information in my computer.
I have searched, but the last option that I have found is to use Shiny package. The last problem is that I don't want that my aplication uses internet.
Is there any package that do that?

Related

How to run a shiny app as a standalone application?

I've some shiny app and I want to execute and to make it standalone application (it will be awesome if it will open via chrome).
I can't upload the app to the Net and I want that also co-workers without R studio or R
will use this app.
because of the security company - I can't download any software except R packages.
I saw here a few solution, but all of them included any software download.
I have done some research on this issue. The commenters are basically correct: you need the R binaries in some way, either a portable R or an R server. But there are solutions that allow it to bundle those with your code and hide the details from your users.
On option is to wrap your app along with
a portable R into a container application like Electron. The electron-quick-start project tries this.
The RInno package provides functions to bundle your app and R portable into an installer app. Every user runs the installer on their system once which will install your app, the packages and the code. But in the end users may not see the difference to other apps. They get a link in the start menu and that's it. I did that successfully. But it did not work out of the box. I had to adjust the output manually in several places.
A second container solution works with docker. That is what ShinyProxy does. See also this blog.
The package shinyShortcut (I quote) "will produce an executable file that runs the shiny app directly in the user's default browser".
Important to note: I haven't tested most of them. From reviewing the solutions I often get the feeling that these solutions might make releases somewhat complicated because there are always manual steps involved.

How can I create a user library for R on Windows 10?

I want to follow the advice I've read and heard to have both a main library in R_HOME/library and a user library. I'm using W10 on a desktop machine (not important, except that it gives me a name by which to refer to it), and I can't make R use the user library.
I have succeeded in doing that on a W10 laptop: C:/R/R-4.0.2/library contains some 30 recommended packages, and C:/Users/[username]/Documents/R/win-library/4.0 con contains a much larger number of packages in my user library.
As I recall, and as I wrote down when I did an upgrade on a server, all you have to do to create a site-library is to create a directory called C:/R/R-4.0.2/site-library, and R will use that the next time it starts.
To create a user library, create the directory C:/Users/[username]/Documents/R/win-library/4.0.
That seemed to work on my laptop, for I have seemingly a working R library and a user library there.
That seemed to work on the server, too: I have a library and a site-library.
In both cases, .libPaths() shows the same libraries that I see with Dired on the disk.
I tried to do the same thing on the desktop machine, and i can't make it work.
I created a directory C:/Users/[username]/Documents/R/win-library/4.0, restarted R, and ran .libPaths(); the only directory that was listed was C:/R/R-4.0.2/library.
Because I thought the Documents in that path seemed odd, I tried it again using C:/Users/[username]/R/win-library/4.0, still with no success.
https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Managing-libraries seems pertinent, but I'm not sure how to interpret the output of Sys.getenv("R_LIBL_USER). I get "\\[toplevel]\[nextlevel]\Home$\[username]/R/win-library/4.0", which I presume is a long-winded way to get to /Home$/[username]/R/win-library/4.0 (aka C:/Users/[username]/R/win-library/4.0.
Suggestions? I've tried a number of other suggestions from SO, all to no avail.

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.

Shiny as Stand-Alone Program

I wrote a Shiny app, and now I need to turn it into a Stand-Alone Program. The reasoning behind this is that I need to share the app but can't do this with shinyapps.io or a server as I need the app to be able to access user's folders.
So far, I found these 2 tutorials: deploying-desktop-apps and packaging-your-shiny-app. Both of them (supposedly) work on Windows, but I have a Mac, and I want to app to be available for users of all systems, or at least Mac and Linux. Any thoughts and suggestions would be appreciated!
I actually tried to follow the tutorial mentioned above, and can't even install R-portable for my Mac. So I'm looking for something different.
Running a Virtual Machine to follow Windows tutorial is an option, but in this case, the app will be Windows-specific, and I don't want this.
This thread is really old I know, but I'm also trying to find answers on creating a standalone version of R for Mac.
This would support for
https://github.com/chasemc/electricShine
which supports Windows

Deploying R shiny app as a standalone application [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 months ago.
The community reviewed whether to reopen this question 5 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I have developed a RShiny application which I would like to share internally with my colleagues (Hosting the app on a server, is not an option at this stage).
I was exploring various options, and I came across a technique for bundling your app as a standalone desktop application, with an installer file, which you can then share & distribute. (The approach is explained here & here)
This is quite neat, because the users installing it need not have R (and any other required packages) to install and run the app (it has portable versions of R, chrome etc)
I was able to follow the approach and create a standalone desktop application, with an installer file, which I can now start sharing.
However, this is my concern:
Ideally, I would not want my users to be able to access the source code. Is there a way to restrict such access? In the tutorial (the first link that I posted), this is what the author says:
*
Lastly, keep in mind that your source code is easily accessible. If
this is a concern for you (e.g. if you are distributing to a client
that should not have access to the code) the best you can do is impede
access by first compiling the sensitive source code into a binary
package. That said, any user who knows R (and has sufficient intent)
can simply dump the code to the console.
*
Are there better, more fool-proof ways to impede access?
Thanks!
There is now a way to turn a Shiny app into a standalone Electron app (which is a desktop app, used for apps like Slack). To find out more, see this excellent presentation (YouTube) from useR 2018, which contains further links:
GitHub ColumbusCollaboratory: electron-quick-start
GitHub ColumbusCollaboratory: Photon. RStudio Add-in to build Shiny apps utilizing the Electron framework
#TravisHinkelman's blog "Deploying a Shiny app as a desktop application with Electron"
I'm not sure if it would be a great fit on the code obscurity question, but the RInno package is designed to help with the data security problem, i.e. when a company does not want to share their data with a third party. It also automates the process you referenced above and allows you to connect your app to GitHub/Bitbucket to push out updates to locally installed shiny apps via API calls on startup.
To get started:
install.packages("RInno")
require(RInno)
RInno::install_inno()
Then you just need to call two functions to create an installation framework:
create_app(app_name = "myapp", app_dir = "path/to/myapp")
compile_iss()
If you would like to include R for your co-workers who don't have it installed, add include_R = TRUE to create_app:
create_app(app_name = "myapp", app_dir = "path/to/myapp", include_R = TRUE)
It defaults to include shiny, magrittr and jsonlite, so if you are using other packages like ggplot2 or plotly, just add them to the pkgs argument. You can also include GitHub packages to the remotes argument:
create_app(
app_name = "myapp",
app_dir = "path/to/myapp"
pkgs = c("shiny", "jsonlite", "magrittr", "plotly", "ggplot2"),
remotes = c("talgalili/installr", "daattali/shinyjs"))
If you are interested in other features, check out FI Labs - RInno. If you'd like a guide on how to connect it to GitHub/Bitbucket check out the Continuous Installation guide :).
You might be interested in DesktopDeployR, a framework for deploying self-contained R-based applications to the desktop.
https://github.com/wleepang/DesktopDeployR
I'm not familiar with that approach, is it common? I personally haven't ever seen it. It looks like essentially what you're doing is bundling R, Shiny, a web browser, and your code, into a file. It's as if the client installs R, Chrome, shiny, and runs your code, but he just does it all in one click. You're literally giving the user your code. I don't know how it works, but if the author himself claimed that the client will be able to see the source code, then that makes sense to me and I don't think you can avoid that.
Why not just host the file on a shiny server or shinyapps.io? The client won't see your code then. Also, is it really that important that they can't see your code? A lot of times people are afraid of others seeing their code but in reality nobody really cares to look at others people's code and steal it. Unless you have some very proprietary and advanced patented code.
You can also run your shiny app from a ".bat" executable file with code that runs your app from the command line.
Just open a txt editor and add the following line:
R -e "shiny::runApp('app.R',launch.browser=TRUE)
You can save it as, for example "test.bat". Rename app.R to whatever your shiny app name is. Make sure you have the launch browser set to TRUE, otherwise the app will only be "listening".
If you want to make sure any Rmd reporting works smoothly, also add the pandoc path to the code of your shiny app. For example add the line:
Sys.setenv(RSTUDIO_PANDOC="C:/Program Files/RStudio/bin/pandoc")
You can get your pandoc path by running: rmarkdown::find_pandoc()
Also make sure R is in your path environment (e.g. add "C:\Program Files\R\R-4.1.0\bin" to your path environment)
Users will have access to your source code if they really want to and R needs to be installed on the PC that runs the bat file, but it might be a nice way to quickly deploy a shinyapp, for instance, for small teams that have a shared workstation. And you don't need to pay for or install a server.

Resources