Error installing shinyapps - r

I've been having trouble downloading the shinyapps package on my windows computer. I've updated my versions of R and studio, tried the devtools download devtools::install_github('rstudio/shinyapps') and I've also tried the manual download of the shinyapps-master.zip (github.com/rstudio/shinyapps/archive/master.zip) and using install_local() all to no avail.
Here is the error I get with each method:
Installing shinyapps
"C:/Program Files/R/R-3.1.1/bin/i386/R" --vanilla CMD INSTALL \
"C:\Users\MyName\AppData\Local\Temp\Rtmpma2fl1\devtools10cc1745fe7\shinyapps-master" \
--library="C:/Program Files/R/R-3.1.1/library" --install-tests
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Error: Command failed (1)
After doing the excellent tutorial for shiny I would love to be able to use shinyapps.io but can't so far due to this. Any ideas? Much appreciated!

The app does not like the fact that R is installed in a directory that includes a space. I recommend reinstalling R to a location without a space, e.g. c:/R/.

I got a similar problem. I deleted the shinyapp folder first and then the file with that name. All my packages are saved in ~/Documents/R/win-library/3.1 folder on Windows 7 PC as I have not specified the lib folder. Then I installed the shinyapps package again using devtools::install_github('rstudio/shinyapps') command in R. HTH

Related

InstallationWarning: package 'XYZ' is in use and will not be installed: R

I am trying to install package SBCK from R build using Rscript build.R -c -v -i in windows command prompt following the steps given here. However, I ended up with package SBCK being not installed because of following error/warning InstallationWarning: package 'SBCK' is in use and will not be installed. I have no package with name SBCK installed on my system, so I do not understand why I am getting this warning message and thus not to be able to install the R package.
I know that similar question have been asked before here but solution there does not work in my case.
I am using R version 4.2.0 on Windows 10.
Once 'build.R' is run, "SBCK_0.5.0.tar.gz" is created in the 'SBCK-R' folder.
You can now install it via the package archive file option or pointing to that file in the install.packages command. I faced the same issue and this solved it.

R: Error in install.packages : cannot open the connection

I was trying to install the package RINDSEL but I am unable to install it and I keep getting the following error:
Error in install.packages : cannot open the connection
I downloaded the package from:
rindsel_1.0_2.zip | Integrated Breeding Platform
and loaded it from the directory. Other packages from the directory can be installed but just not this one.
Is the package corrupt or could there be any other error?
I would really be grateful for any help. Thanks in advance
Rename the zip file RinSel Software into Rindsel. That's the name specified in the discription file.
Then, you can install the package in R with the command
install.packages("C:/path/to/Rindsel.zip",repos=NULL,type="win.binary")
That works fine... at first (!!!).
Problem with the Rindsel package is. It is quite old. It was build with R 2.13.1. Therefore, if you want to load the library which would be the next step to use the package in R you will get the error:
Problems building package (Error: "package has been build before R-3.0.0")
My suggestion: Contact the authors of the package and ask them if they can either provide the source file that you can build the package by yourself or if they can bundle the Rindsel package with a newer R version.
(Or you could try to hunt down an old R version and see if you can get the thing running with an old R... However, I would not seriously suggest to do that. It would probably result in conflicting dependencies with the other required packages...)
EDIT 15-02-2018: OP asked if one can build an R package with sources that are presumeably the Rindsel source files.
Yes, basically, you could do that. You would have to make a your own description and namespace file and put the source file in the R folder than invoke the command in R to build it....
But it's not neccessary with the script files provided by the link the OP posted.
OP, just run the scripts in R! It's quite easy.
Download the zip-file and extract it on your machine.
Go to that directory. The R command would be
setwd('path/to/your/directory')
Than run the R script, e.g, the KNIndex.r. It's simple:
source('KNIndex.r')
Then the script will run and produce some output / prompts.
For future readers,
I was able to fix the error by running RStudio with administrative privileges to get the command to work.
If that does not fix it, you might wish to try
Installing "r tools" if that is not installed already. That can be downloaded from
https://cran.r-project.org/bin/windows/Rtools/
Download a relevant package that you are trying to install (e.g., tidyverse_1.3.0.zip) from https://cran.rstudio.com/
and install that from local path
It can also be installed directly from the web using install.packages("https://cran.rstudio.com/bin/windows/contrib/4.0/tidyverse_1.3.0.zip")
I had the same problem. R was not able to extract and compile the package files to the default installation directory for some system-specific reasons (not R related).
I was able to fix this by specifying the installation directory of the package lib using:
install.packages("your package", lib = 'path/to your/required/installation/directory')
You can then load the package by specifying the lib.loc option while loading it:
library('your package', lib.loc='path/to your/required/installation/directory')
A better solution:
Create a new environment variable (if you are using windows) R_LIBS_USER with the following directory path/to your/required/installation/directory.
This will change the default installation directory of the packages and make it easier to load and install them without specifying the location everytime.

How to use R CMD INSTALL to install only essential files

I am using R CMD INSTALL to install libraries from a folder with .zip binaries to my rlibs directory. When I do this, many folders for each library are installed in the rlibs directory. Take for example the bit package. I have downloaded the bit_1.1-12.zip file from https://cran.r-project.org/web/packages/bit/index.html.
Now I install it by using the following command:
R CMD INSTALL --library=./r_libs ./external/bit_1.1-12.zip
This will create a file structure underneath the folder ./r_libs/bit
Now here is my question: How can I install only the essential library files that R needs to import? I believe this is the ./r_libs/bit/libs/ folder (I might be wrong). Currently there is plenty of additional folders installed, such as html, help, Meta, and more.
I have tried several options that R CMD INSTALL --help gives me. The description in https://stat.ethz.ch/R-manual/R-devel/library/utils/html/INSTALL.html tells me to install just the compiled code for another sub-architecture, use --libs-only. However,
R CMD INSTALL --libs-only --library=./r_libs ./external/bit_1.1-12.zip
gives me an error message that there is no ./r_libs/bit/lib directory. The options --no-html, --no-help seem to not do anything.
I am working on a Windows 7 machine using R add-on package installer 3.0.2.
What am I missing here?
Thank you.

Error while installing Apache SparkR package

I am getting the following error while installing the apache sparkr package:
install_github("amplab-extras/SparkR-pkg", subdir="pkg")
Downloading github repo amplab-extras/SparkR-pkg#master
Installing SparkR
Error in isNamespaceLoaded(pkg) :
attempt to use zero-length variable name
I was able to load the SparkR library in R/RStudio by doing the following:
Download and setup SparkR
1. Download spark-1.4.0 and untar/unzip it
2. Install spark, then go to your directory /spark01.4.0/R
3. In a terminal, run ./install-dev.sh. This will create a folder called "lib" in your directory
Add SparkR to R .libPaths()
4. In a terminal:
cat >> $HOME/.Rprofile <<EOT
lib_path <- .libPaths()
lib_path <- c(lib_path,"/MyDirectory/spark-1.4.0/R/lib")
.libPaths(lib_path)
rm(lib_path)
EOT
Load R, then use library(SparkR).
I've been having the same problem with the pander package and managed a long-winded work around. I installed pander from Github to an earlier version of R (3.1.2 worked for me). I then copied across the package from \library\pander into my new R v3.2.0 installation. So far it seems to be working fine.
I've had a go at doing this for the sparkr package, but unfortunately it requires a more recent build of R. You might find that R v3.1.3 will work, but I'm not able to test that on my machine.

shinyapps.io and github Packages

I have a shiny program in R that works great. But I am having trouble deploying it to shinyapps.io.
The javascript error console gives me the following error:
Listening on http://127.0.0.1:46574
Downloading github repo jlisic/saAlloc#master
Installing saAlloc
'/usr/lib/R/bin/R' --vanilla CMD INSTALL \
'/tmp/RtmpvmoFM3/devtools2c6b564aad/jlisic-saAlloc-62692fc' \
--library='/usr/local/lib/R/site-library' --install-tests
Error: ERROR: no permission to install to directory ‘/usr/local/lib/R/site-library’
Error : Command failed (1)
There is nothing fancy about my package it just has a default Makevars file. Any help or suggestions would be appreciated.
I have also been struggling with this issue, and I just found a working answer in the shinyapps.io Google users group by #Yihui. Quoting his post:
You should not install the package inside your app (i.e. do not call
install_github() in your app code). Just install it locally, and
shinyapps.io will figure out how to install it on the server.
https://groups.google.com/d/msg/shinyapps-users/5S8jTJ-SeHM/HCPGUjYVUM4J
Removing the devtools::install_github() line in server.R worked for me. Back end magic!
EDIT: The reason why this works is explained in more detail in this rsconnect issue: https://github.com/rstudio/rsconnect/issues/88

Resources