Installing shiny on AWS EC2 ubuntu 20.4 fail - r

I keep struggling installing shiny on a ubuntu 20.4 vm on EC2.
I followed this procedure.
Then I tried:
install.packages("shiny")
install.packages("shiny", dependencies = T)
install.packages("shiny", dependencies = T, INSTALL_opts ='--no-lock')
I also add 4GB of SWAP memory.
But no way...
Here are my outputs:
** R
** demo
** byte-compile and prepare package for lazy loading Error: package ‘promises’ was installed before R 4.0.0: please re-install it
Execution halted ERROR: lazy loading failed for package ‘httpuv’
removing ‘/usr/local/lib/R/site-library/httpuv’ ERROR: dependency ‘openssl’ is not available for package ‘httr’
removing ‘/usr/local/lib/R/site-library/httr’ ERROR: dependency ‘textshaping’ is not available for package ‘ragg’
removing ‘/usr/local/lib/R/site-library/ragg’ ERROR: dependency ‘httpuv’ is not available for package ‘shiny’
removing ‘/usr/local/lib/R/site-library/shiny’ ERROR: dependency ‘httr’ is not available for package ‘webdriver’
removing ‘/usr/local/lib/R/site-library/webdriver’ ERROR: dependencies ‘httr’, ‘shiny’, ‘webdriver’, ‘httpuv’ are not available
for package ‘shinytest’
removing ‘/usr/local/lib/R/site-library/shinytest’
The downloaded source packages are in
‘/tmp/RtmpGvP9AB/downloaded_packages’ Warning messages: 1: In
install.packages("shiny", dependencies = TRUE) : installation of
package ‘openssl’ had non-zero exit status 2: In
install.packages("shiny", dependencies = TRUE) : installation of
package ‘textshaping’ had non-zero exit status 3: In
install.packages("shiny", dependencies = TRUE) : installation of
package ‘httpuv’ had non-zero exit status 4: In
install.packages("shiny", dependencies = TRUE) : installation of
package ‘httr’ had non-zero exit status 5: In
install.packages("shiny", dependencies = TRUE) : installation of
package ‘ragg’ had non-zero exit status 6: In
install.packages("shiny", dependencies = TRUE) : installation of
package ‘shiny’ had non-zero exit status 7: In
install.packages("shiny", dependencies = TRUE) : installation of
package ‘webdriver’ had non-zero exit status 8: In
install.packages("shiny", dependencies = TRUE) : installation of
package ‘shinytest’ had non-zero exit status
Each time I try to install a dependency "by hand", an other missing one, deeper nested, shows up.
Could someone help me with this, please ?

Not sure if you were able to solve your issues. Recently I also faced similar issues in trying to install Shiny server and related packages in EC2. I researched a bit and came across a Rstudio server AMI (Amazon Machine Image)- https://www.louisaslett.com/RStudio_AMI/, maintained by Louis Aslett. You can choose the AMI from the nearest region and once the instance is up and running, you can directly start using R-studio or Shiny. I find it very helpful.

To install openssl R package, you'll also need system-wide installation of the samename package. You could try something like sudo apt-get install openssl. Search the internet for dependencies of other packages.

Related

How can I install rayshader on an AWS machine?

I have been trying to solve this problem for a few hours but I can't find any way to do it. The command that I have used is: install.packages("rayshader")
I have tried to install the 'rayshader' package on an AWS machine with an EC2 instance. The intention of this installation is to be able to run a make command for the auto creation of a RMD report containing 3D graphics from 'rayshader'.
The errors returned by the execution are as follows:
make: *** [RcppArmadillo.so] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo’
ERROR: dependencies ‘jpeg’, ‘RcppArmadillo’ are not available for package ‘rayimage’
* removing ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.4/rayimage’
ERROR: dependencies ‘raster’, ‘rayimage’, ‘RcppArmadillo’ are not available for package ‘rayshader’
* removing ‘/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.4/rayshader’
The downloaded source packages are in
‘/tmp/RtmpDWE73c/downloaded_packages’
Warning messages:
1: In install.packages("rayshader") :
installation of package ‘jpeg’ had non-zero exit status
2: In install.packages("rayshader") :
installation of package ‘RcppArmadillo’ had non-zero exit status
3: In install.packages("rayshader") :
installation of package ‘rayimage’ had non-zero exit status
4: In install.packages("rayshader") :
installation of package ‘rayshader’ had non-zero exit status
Please, any help would be greatly appreciated!

Deploy R on Azure on Linux (centos 8.2.2004)

I am trying to install R Shiny on Azure , Linux (centos 8.2.2004). Using the manual : https://linuxize.com/post/how-to-install-r-on-centos-7/
However I can not install packages. I receive error :
"ERROR: failed to lock directory ‘/usr/lib64/R/library’ for modifying Try removing ‘/usr/lib64/R/library/00LOCK-Rcpp’ ERROR: dependency ‘Rcpp’ is not available for package ‘later’
* removing ‘/usr/lib64/R/library/later’ ERROR: dependencies ‘Rcpp’, ‘later’ are not available for package ‘promises’
* removing ‘/usr/lib64/R/library/promises’ ERROR: dependencies ‘Rcpp’, ‘promises’, ‘later’ are not available for package ‘httpuv’
* removing ‘/usr/lib64/R/library/httpuv’ ERROR: dependencies ‘httpuv’, ‘later’, ‘promises’ are not available for package ‘shiny’
* removing ‘/usr/lib64/R/library/shiny’
The downloaded source packages are in
‘/tmp/RtmpGIfMqF/downloaded_packages’ Updating HTML index of packages in '.Library' Making 'packages.html' ... done Warning messages: 1: In install.packages("shiny") : installation of package ‘Rcpp’ had non-zero exit status 2: In install.packages("shiny") : installation of package ‘later’ had non-zero exit status 3: In install.packages("shiny") : installation of package ‘promises’ had non-zero exit status 4: In install.packages("shiny") : installation of package ‘httpuv’ had non-zero exit status 5: In install.packages("shiny") : installation of package ‘shiny’ had non-zero exit status"
I have tried to fix the issue however , was able. If you have some ideas, please advice, thanks.
I solved the problem finally. There was necessary to delete the folder :
sudo rm -rf /usr/lib64/R/library/00LOCK-Rcpp
Then tried instal shiny package again and worked fine.

Can't install Codebook package in R

I am attempting to install the R package "codebook" on OSX. I receive the following error message. I receive similar error messages when I try to independently install these dependencies. Is there a way that I install via the terminal or otherwise install these dependencies?
My apologies if this is not enough information in order to provide guidance. Please let me know and I would be happy to provide additional context. I am using RStudio Version 1.0.136
Thank you
ERROR: compilation failed for package ‘RcppEigen’
installation of package ‘RcppEigen’ had non-zero exit status
ERROR: dependencies ‘lavaan’, ‘OpenMx’, ‘semTools’ are not available for package ‘MBESS’
installation of package ‘MBESS’ had non-zero exit status
ERROR: dependency ‘igraph’ is not available for package ‘DiagrammeR’
installation of package ‘DiagrammeR’ had non-zero exit status
ERROR: dependency ‘RcppEigen’ is not available for package ‘lme4’
installation of package ‘lme4’ had non-zero exit status
ERROR: dependency ‘DiagrammeR’ is not available for package ‘data.tree’
installation of package ‘data.tree’ had non-zero exit status
ERROR: dependencies ‘car’, ‘data.tree’, ‘DiagrammeR’, ‘lavaan’, ‘lme4’, ‘MBESS’ are not
available for package ‘userfriendlyscience’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/userfriendlyscience’
Warning in install.packages :
installation of package ‘userfriendlyscience’ had non-zero exit status
ERROR: dependency ‘userfriendlyscience’ is not available for package ‘codebook’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/codebook’

Non-zero exit status when attempting to install devtools in R on MacOS

I've been trying to install devtools in R on MacOS, first by using in RStudio:
install.packages("devtools")
and then using as an alternative:
install.packages("devtools",lib="/usr/local/Cellar/r/3.6.0_3/lib/R/library")
This gave permission errors, therefore I then used the terminal:
sudo R
then using the same commands as in RStudio to install the package, which gave me the following error(s) for both commands:
1: In install.packages("devtools", lib = "/usr/local/Cellar/r/3.6.0_3/lib/R/library") :
installation of package ‘xml2’ had non-zero exit status
2: In install.packages("devtools", lib = "/usr/local/Cellar/r/3.6.0_3/lib/R/library") :
installation of package ‘roxygen2’ had non-zero exit status
3: In install.packages("devtools", lib = "/usr/local/Cellar/r/3.6.0_3/lib/R/library") :
installation of package ‘devtools’ had non-zero exit status
I do not have experience using R, and the solutions mentioned online when using Ubunu or CentOS do not work.
Please let me know if you have suggestions on how to install devtools and what is causing these errors, any suggestions are highly appreciated.
Thank you in advance!
Using dependencies=TRUE does a lot more installations, but still gives the following result:
The downloaded source packages are in
‘/private/tmp/RtmptCt93z/downloaded_packages’
Warning messages:
1: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘xml2’ had non-zero exit status
2: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘RCurl’ had non-zero exit status
3: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘rvest’ had non-zero exit status
4: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘roxygen2’ had non-zero exit status
5: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘rversions’ had non-zero exit status
6: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘spelling’ had non-zero exit status
7: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘rsconnect’ had non-zero exit status
8: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘foghorn’ had non-zero exit status
9: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘devtools’ had non-zero exit status
10: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘pkgdown’ had non-zero exit status
I tried manually adding the path shown in RStudio to my .bash_profile, which resulted in my terminal not knowing any commands (sudo, nano, etc) anymore, which way would be the correct one to do this, is maybe the path to R the problem?
> R.home()
[1] "/usr/local/Cellar/r/3.6.0_3/lib/R"
I finally solved it by downloading devtools directly via https://cran.r-project.org/web/packages/devtools/devtools.pdf (as suggested by #NelsonGon)
Then moving that folder to R.home()/library
then running devtools using sudo in the terminal to install github packages.

Error installing ggplot2

I was trying to run a simple code on ggplot2 and got the following error:
source("u1.txt")
Error in library(ggplot2) : there is no package called ‘ggplot2’
Error : package ‘foreign’ was built before R 3.0.0: please re-install it
ERROR: lazy loading failed for package ‘maptools’
* removing ‘/home/shivangi/R/i686-pc-linux-gnu-library/3.0/maptools’
* installing *source* package ‘multcomp’ ...
** package ‘multcomp’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (multcomp)
ERROR: dependencies ‘plyr’, ‘reshape2’, ‘scales’ are not available for package ‘ggplot2’
* removing ‘/home/shivangi/R/i686-pc-linux-gnu-library/3.0/ggplot2’
The downloaded source packages are in
‘/tmp/RtmpOGWrr4/downloaded_packages’
Warning messages:
1: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘Rcpp’ had non-zero exit status
2: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘plyr’ had non-zero exit status
3: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘testthat’ had non-zero exit status
4: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘reshape2’ had non-zero exit status
5: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘scales’ had non-zero exit status
6: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘Hmisc’ had non-zero exit status
7: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘maptools’ had non-zero exit status
8: In install.packages("ggplot2", dep = TRUE) :
installation of package ‘ggplot2’ had non-zero exit status
I had the same error running ggplot this evening, essentially you need to try to install all the dependencies that failed. For me it was "scales", then "munsell" and then finally (the actual problem) "colorspace" which hadn't be updated since I upgraded to 3.1.1. In your case, it looks like you want to first try installing "foreign" and then try ggplot2 again. Keep loading dependencies that error manually until you find the real problem.
You can specify that the install.packages() call also install all dependent packages:
if(!require(ggplot2)) install.packages('dplyr',dependencies = TRUE)
the above code first checks to see if ggplot2 package is loaded, if not it tries to load the apckage. If it cannot load the package, it then tries to install the package and all of package its dependencies.
With RTools installed, I got this to work:
install.packages("ggplot2", type="source",dependencies = TRUE)
Compiled a few packages...
Make sure your PATH is updated to point to RTools properly, i.e. includes
c:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin
at the front.
I am using Rtools32.exe

Resources