Unable to run R shiny containing a locally installed package - r

I want to deploy an application on R shiny on the web, but I get this error
Preparing to deploy application...DONE
Uploading bundle for application: 63131...Error:
* Unable to deploy package dependency 'CellMix'
The package was installed locally from source. Only packages
installed from CRAN, BioConductor and GitHub are supported. Execution
halted
Is there a work around to run the application and deploy on the web.

Related

How to Deploy Local Package to Shinyapps.io

I am trying to deploy an app to Shiny.io with a new package via rsconnect::deployApp() that I have developed locally and not hosted on CRAN. My question is similar to this one but I cannot solve using the same recommendation.
My package is installed on a private github repository and my shinyapps.io account settings have access to this private repo. My app depends on packages both on CRAN and now also this new one I have developed.
Could use a bit of direction on how to solve this.
Thanks
Uploading bundle for application: 5447651...Warning:
* May be unable to deploy package dependency 'Mycpp'; could not determine a repository URL for the source 'CRAN'.
* Unable to determine the source location for some packages. Packages should be installed from a package repository like CRAN
or a version control system. Check that options('repos') refers to a package repository containing the needed package
versions.
DONE
Deploying bundle: 6849209 for application: 5447651 ...
Waiting for task: 1273530594
building: Processing bundle: 6849209
building: Parsing manifest
building: Building image: 8100493
building: Fetching packages
building: Building package: Mycpp
################################ Begin Task Log ################################
################################# End Task Log #################################
Error: Unhandled Exception: Child Task 1273530595 failed: Error building image: Error fetching Mycpp (1.0) source. <CRANPackageSource repo='http://cran.rstudio.org'> unable to satisfy package: Mycpp (1.0)
In addition: Warning message:
In FUN(X[[i]], ...) :
Package 'Mycpp 1.0' was installed from sources; Packrat will assume this package is available from a CRAN-like repository during future restores

deployment of shiny app fails due to cmake

I have a shiny app that uses nloptr , which in turns needs cmake. I installed it locally and everything works, when I try to publish it to an private rsconnect server, it fails with the following error:
[Connect] 2022/12/06 14:24:08.680333733 CMake was not found on the PATH. Please install CMake: ...
So it is clear that the compiler is missing, is there any solution besides asking the server admin to install cmake or a way for R to install it?

deployment on shinyapps.io failing

Hi I'm trying to deploy an app on the server, however, I get the following errors
* May be unable to deploy package dependency "rClr" could not
determine a repository URL for the source CRAN.
* May be unable to deploy package dependency "tlf" could not determine
a repository URL for the source CRAN.
Unable to determine the source location for some packages. Packages
should be installed from a package repository like CRAN or a version
control system. Check that options(repos) refers to a package
repository containing the needed package versions.
The backbone packages can not be installed from Cran and have to be done manually, hence the errors. How can this be fixed in order to deploy the app on the server?
Thanks for all help

packrat init in an existing project does not initialise

I have a working project on Rstudio Server and I want to freeze all packages into the actual working versions to avoid future issues due to global library updates.
So I run
> packrat::init()
Initializing packrat project in directory: - "~/R/statistics"
After a while all packages are downloaded and installed with no apparent issue. So I run a command to get status:
packrat::status()
and I get:
Error: This project has not yet been packified. Run 'packrat::init()' to init packrat.
Restarted R session, Rstudio and even server, but to no avail. Same message no matter I insisted. Maybe this is not the correct procedure to add packrat to an existing project but packrat documentation is not very complete.
Rstudio Server version 1.1.456
R version : 3.4.4

Unable to deploy Shiny application on Shiny Server in Linux VM

I have been trying to deploy my shiny application in shiny server which i have installed on Linux VM (RHEL 6.5, 64 bit) by following the instructions given in this site
The server is started successfully but i get the following when i try to access the sample application provided as a part of the shiny server.
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib64/R/library/Rcpp/libs/Rcpp.so':
/usr/lib64/R/library/Rcpp/libs/Rcpp.so: invalid ELF header
In addition: Warning message:
package ‘shiny’ was built under R version 3.3.0
Error: package or namespace load failed for ‘shiny’ Execution halted
I installed all the required packages without any error still i got this exception when i tried to access the sample application.
The following are the steps i followed to install shiny server.
Installed R. In my office EPEL repository is blocked since it is maintained by a third party organization. So I downloaded the rpm file for R from EPEL website and installed the same using the rpm command.
Next i downloaded the shiny package from the CRAN repository and installed the same using the following command
R CMD INSTALL shiny_0.13.2.tgz
Finally i downloaded and installed the shiny server RPM file.
The server was successfully installed and started without any errors, yet i get the above error when trying to access the application deployed in the server.
I googled a lot for this error but could not find much. Has anybody else faced this issue? Could someone help me out with this?
I found out the issue. I installed all the packages as root user but shiny server runs under a different username "shiny". In order to solve this I started an R session using the following command
sudo R
Then I installed the packages using their source, as my LINUX VM (office machine)did not have internet access. I used the following command for installing the packages from the source. First we need to untar the source and then run the following command.
require(devtools)
install('path-to-the-untared-folder')
The below link helped me in finding out the solution.
R - shiny server on Ubuntu

Resources