Package management in RStudio Connect - r

I have recently started using both RStudio Connect and the RStudio Package manager.
I came across this short page from RStudio that says "You can integrate RStudio Package Manager with both RStudio Server Pro and RStudio Connect for a seamless experience with your R packages.".
Is there some specific documentation or an example? I'm a bit confused about what this means and how the package manager will work with the packrat and rsconnect packages that are used when deploying applications.
If it is relevant to consider, I plan on primarily deploying shiny apps to Connect using the API with scripts similar to the ones that appear in this repo: https://github.com/rstudio/connect-api-deploy-shiny/tree/master/deploy

Just to not leave the question without answer:
For RStudio Connect it is possible to configure the settings related to RStudio Package Manager in the main config file, by default is /etc/rstudio-connect/rstudio-connect.gcfg.
Example peace of config file:
; /etc/rstudio-connect/rstudio-connect.gcfg
[RPackageRepository "CRAN"]
URL = "https://cran-mirror.production.company.com/"
[RPackageRepository "CORPORATE"]
URL = "https://corporate-packages.production.company.com/"
This will equals to following command in R:
options(
repos = c(
CRAN = "https://cran.rstudio.com/",
CORPORATE = "https://corporate-packages.development.company.com"
)
)
Source: https://docs.rstudio.com/connect/admin/appendix/configuration/#RPackageRepository

I work at RStudio and came across your post. This community is mainly for open source users, but for licensors of RStudio's professional products (like RStudio Connect, RStudio Server Pro, and Package Manager), your organization should also have a designated Customer Success Representative that can coordinate a discussion to explain these details to you. You can find the contact information here: https://rstudio.com/about/contact/
You can also file a support ticket here if you need more technical/configuration related guidance:https://support.rstudio.com/hc/en-us/requests/new
We hope to hear from you soon!
Lauren

Related

Installing atom packages with dependencies whilst offline

I've just joined a new office and their security is very tight. Essentially, we cannot go online without connecting to another machine. This means any applications that attempt to connect online won't connect to anything.
I'm trying to set up atom for python development (I've not used atom before and it's all that available to me!) - but the lack of internet is causing an issue.
I understand that to install a package, I can download it from github, and extract it to ~/.atom/packages - and this works! But what do I do with packages with dependencies that haven't been downloaded? Is there a simple way to get the package and the dependency whilst being offline?
I've also noticed that although my office has atom installed there's no 'apm' or 'npm' commands in the terminal...is this common?
thanks

R-Studio setup with offline CRAN repository in Windows

I would like to know what is the mchanism, if there is one, for setting up local CRAN repository in an environment that has no internet access. I have a windows environment but I would love to know if it can also be done in linux environment.
I have heard that I'll need to have a web browser to allow R-studio to find local repository. Not sure if it's true but I would like to find out all the steps to set this R-studio with local repository environemnt.
The idea is to have a fully fuunctional R-studio with full CRAN respository available in an offline environment where any package can be installed easily. I couldn't find any source/link available online that details how this can be achieved.
I know R-Studio is setting a package management tool that allows this functionality but I would like to get this done without spending any money.
I managed to solve this problem by creating a local webserver using Apache and then downloading full CRAN repository (win binaries only). I also had to edit my Rprofile.site file by providing the link to my local webserver.

Publish Shiny app using R studio connect

I am trying to push a shiny app on a machine which has restricted access to the internet. So we just got the CRAN whitelisted but cant whitelist GitHub.
I had a couple of packages on GitHub which now I have compressed as tar.gz file. Now when I still try to publish the app I get the error saying my package was not found in CRAN which is true. So how can I publish this app with my package compressed already on that machine?
Thank you.
You need to change your 'Server.SourcePackageDir'
see below the link of Rstudio connect documentation : https://support.rstudio.com/hc/en-us/articles/226871467-Package-management-in-RStudio-Connect

Building R package for windows on mac

Question:
I am developing an R package. I have not yet submitted to CRAN (and it's not ready to at any rate). I want to send the package to friend for some preliminary testing (he's not a builder) and I just want to see if he can use a few features.
On my Mac version of RStudio, I can generate binaries easily. It creates a file called "iatgen_1.0.tgz"
Can my friend use that to install my early build on his windows machine? Or do I need to do something to that file to make it usable for a windows user. Let's assume I have NO access to a windows machine. What can I do from my mac to make this package usable by windows users?
I am posting my comment as an (extended) answer because I think it will help you. When I built my package, I did not have access to Windows either and was suffering from the same issue. I discovered the the Windows build service offered at http://win-builder.r-project.org/ and it worked great. You'll need to do a few things before you send it in, and this is all explained on the site.
First, build your source package with R CMD build. Next, check the package with R CMD check. If this succeeds, follow the rest of the instructions on the site and if all goes well they will send you a link to the temporary directory on their server where you can download the Windows build. If all does not go well, Mr. Ligges will send you an email with the detailed issues so you can fix them and try again.
Like I said, the service worked very well for me. The response was prompt and there were absolutely no problems.

RShiny - How to share app within network

I created an R Shiny application that I'd like to share with my co-workers within my network.
I tried hosting the app on my computer so that other users from the network could access it and use it with their data files.
I tried:
runApp("appname",host="0.0.0.0",port=3986)
And also:
runApp("appname",host="DNSMachinename")
The latter attempt resulted in the following error:
While my colleagues are able to acceess the app, it doesn't really run like it does on my machine.
Thanks for the help.
Since you showed your interest in Shiny server, and it might be more convenient for me to just post a few thoughts in the "answer" since it won't fit well in the comment.
Since you have a group, and I would highly recommend you take a look at R server and shiny server.
(1) Shiny server
You can totally install Shiny server on a old computer and I would recommend using Linux OS like (Ubuntu) and it will save you some time following the tutorial. We have a cluster and we used one of the servers there to host a shiny server and shiny server at the same time. And only internal employee can access it and it is within company's network.
(2) R server
I am not exactly sure which environment you are using to program R but if you want to evangalize R in your team. Have a stable environment that could be accessed by everyone inside your company with authentication is a good way to get started.
(3) shinyapps.io
Is a free platform that you can host your shiny app, it is in alpha version and I don't think there is much authentication or security built in. HEREenter link description here is an example hosted on shinyapps.io
(4) AWS free tier
If you have never used AWS before, you can have a micro instance running on AWS free for one year! I would highly recommend using AWS instead F* around with a old computer.
If you are still trying to get buy-in for your server or cloud solution, I just finished developing the RInno package for this exact problem, i.e. when a company will not pay for Shiny Server or there are security concerns with cloud services.
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
The shiny tutorial list a number of ways to share your app. I particularly hosting a zip file somewhere with the app, and letting your co-workers use runUrl to automatically download the app and run it locally. In this way people can continue to run the latest version of the app, but it does not run on your machine.

Resources