Install R package from source, without changing PATH (Windows) - windows

I'm trying to install package rpart for R-2.14.0 on Windows 7, but I get the warning:
package ‘rpart’ is not available (for R version 2.14.0)
So I download the tar.gz file from the package page. I have installed Rtools but I disabled all the options, including the one that changes the PATH. Then I do the following:
> install.packages("C:/rpart_3.1-50.tar.gz", type="source")
Installing package(s) into ‘C:/Users/backupSam/Documents/R/win-library/2.14’
(as ‘lib’ is unspecified)
inferring 'repos = NULL' from the file name
* installing *source* package 'rpart' ...
** libs
*** arch - i386
ERROR: compilation failed for package 'rpart'
* removing 'C:/Users/backupSam/Documents/R/win-library/2.14/rpart'
* restoring previous 'C:/Users/backupSam/Documents/R/win-library/2.14/rpart'
Warning messages:
1: running command 'C:/PROGRA~1/R/R-214~1.0/bin/i386/R CMD INSTALL -l "C:/Users/backupSam/Documents/R/win-library/2.14" "C:/rpart_3.1-50.tar.gz"' had status 1
2: In install.packages("C:/rpart_3.1-50.tar.gz", type = "source") :
installation of package ‘C:/rpart_3.1-50.tar.gz’ had non-zero exit status
Any suggestions?

Since you have to set the PATH, but you're hesitant to do so because you're afraid you may hose something up, you can do it temporarily in your R session via:
pathRtools <- paste(c("c:\\Rtools\\bin",
"c:\\Rtools\\MinGW\\bin",
"c:\\MiKTeX\\miktex\\bin",
"c:\\R\\bin\\i386",
"c:\\windows",
"c:\\windows\\system32"), collapse=";")
Sys.setenv(PATH=paste(pathRtools,Sys.getenv("PATH"),sep=";"))

Related

rgl package has non-zero status

installing to /home/mhasanyar/R/x86_64-pc-linux-gnu-library/3.4/rgl/libs
** R
** demo
** inst
** preparing package for lazy loading
Error : object ‘hcl.colors’ is not exported by 'namespace:grDevices'
ERROR: lazy loading failed for package ‘rgl’
removing ‘/home/mhasanyar/R/x86_64-pc-linux-gnu-library/3.4/rgl’
Warning in install.packages :
installation of package ‘rgl’ had non-zero exit status
You are using an old R version, earlier than R 3.6.0 where hcl.colors was introduced. The best thing you can do would be to update R, and then things should work.
If you can't do that or don't want to, then you can install rgl into versions as early as R 3.3.0, but you need to get the development version to do that. It contains a number of fixes to get it working in old R versions. The easiest way to do this is to install the remotes package, then run
remotes::install_github("dmurdoch/rgl")

Problems with rcpp install - command not found

On a Mac with Sierra OS and the latest versions of xcode command line tools and r/rstudio, when trying to install rcpp I get the following error. Is this a path problem? Any help would be greatly appreciated!
> install.packages("Rcpp", type = "source")
trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_0.12.12.tar.gz'
Content type 'application/x-gzip' length 2421289 bytes (2.3 MB)
==================================================
downloaded 2.3 MB
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
sh: mv: command not found
** libs
sh: make: command not found
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp’
sh: rm: command not found
Warning in install.packages :
installation of package ‘Rcpp’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/hn/zpnk2qsx19x1y974vym8wr7r0000gn/T/RtmptRz4Oe/downloaded_packages’

Error downloading shinyapps from github

I'm trying to download the package shinyapps following the instructions given in:
http://shiny.rstudio.com/articles/shinyapps.html
but I am having some errors.
I am on Windows 64 bit; my R version is R x64 3.2.1; my RStudio version is 0.99.447.
Here you can find the command I used:
if (!require("devtools"))
install.packages("devtools")
devtools::install_github("rstudio/shinyapps")
The devtools package seems correctly installed but I get the following error:
Downloading github repo rstudio/shinyapps#master
Installing shinyapps
"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore CMD INSTALL \
"C:/Users/myname/AppData/Local/Temp/RtmpsbU7D7/devtools112063ad32a2/rstudio-shinyapps-688a4ac" \
--library="\\someadress/R/win-library/3.2" --install-tests
* installing *source* package 'shinyapps' ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
there is no package called 'shinyapps'
Error: loading failed
Execution halted
*** arch - x64
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
there is no package called 'shinyapps'
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'
* removing '\\someadress/Users/myname/Documents/R/win-library/3.2/shinyapps'
Error: Command failed (1)
I also tried to manually download the package from github (shinyapps-master.zip), unzip the folder and copy the folder into the R library folder. First of all the folder is not called shinyapps but shinyapps-master; I tried to call the library both as shinyapps and shinyapps-master but without success. Do you have any suggestions?

Cannot install package "predictionet" on Windows

I am trying to install predictionet but having troubles. Clearly there are no windows binaries available so I have been trying to install by building from source.
I have Rtools installed from here.
So far I have tried to use this command:
> install.packages("C:/Users/Blah/predictionet_1.10.0.tar.gz", repos = NULL, type="source")
But I am receiving this error message:
Installing package into ‘C:/Users/Blah/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
* installing *source* package 'predictionet' ...
** libs
*** arch - i386
Warning: running command 'make -f "C:/PROGRA~1/R/R-31~1.0/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.0/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="predictionet.dll" OBJECTS="foo_mrmr.o mrnet_adapted.o mrnet_adapted2.o mrnet_ensemble_standalone.o"' had status 309
ERROR: compilation failed for package 'predictionet'
* removing 'C:/Users/Blah/Documents/R/win-library/3.1/predictionet'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\Blah\Documents\R\win-library\3.1" "C:/Users/Blah/Desktop/predictionet_1.10.0.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Users/Blah/Desktop/predictionet_1.10.0.tar.gz’ had non-zero exit status
I am new to R so have no idea how to go about troubleshooting this, any help would be much obliged!
Note: I am using Rstudio
You may try :
source("http://bioconductor.org/biocLite.R")
biocLite("predictionet")

Error running Rstudio after install

I get the following error message when installing Rstudio:
"Error installing package: '\corp.corpcommon.com\users\E212\MY Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing source package 'rstudio' ...
** R
** inst
Warning in file.create(to[okay]) :
cannot create file '\corp.corpcommon.com/users/E212/MY Documents/R/win-
library/3.1/rstudio/CITATION', reason 'No such file or directory'
** preparing package for lazy loading
** help
* installing help indices
** building package indices
** testing if installed package can be loaded
* arch - i386
* arch - x64
ERROR: loading failed for 'i386', 'x64'
* removing '\corp.corpcommon.com/users/E212/MY Documents/R/win-library/3.1/rstudio'
Error installing package: '\corp.corpcommon.com\users\E212\MY Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing source package 'manipulate' ...
** R
** preparing package for lazy loading
** help
* installing help indices
** building package indices
** testing if installed package can be loaded
* arch - i386
* arch - x64
ERROR: loading failed for 'i386', 'x64'
* removing '\corp.corpcommon.com/users/E212/MY Documents/R/win-library/3.1/manipulate'"
Do anyone know what it is, what it means, and how I can fix it?`
Thanks in advance :)
Rename MY Documents to MYDocuments. so the file path will be '\corp.corpcommon.com\users\E212\MYDocuments'.

Resources