R 'mvpart' package - any option to use in R 3.1.x? - r

I would like to use functions in the mvpart package in R. I know it has been removed from CRAN, but I tried installing archive versions available here: http://cran.r-project.org/web/packages/mvpart/index.html
install.packages("D:/mvpart_1.6-2.tar.gz", repos = NULL, type = "source")
I get this result:
Installing package into ‘C:/Users/jk/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
* installing source package 'mvpart' ...
** package 'mvpart' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "C:/PROGRA~1/R/R-31~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.3/share/make/winshlib.mk" SHLIB="mvpart.dll" OBJECTS="anova.o branch.o bsplit.o choose_surg.o dist.o fix_cp.o formatg.o free_tree.o gini.o graycode.o insert_split.o make_cp_list.o make_cp_table.o mrt.o mysort.o nodesplit.o partition.o poisson.o pred_rpart.o rpart.o rpart_callback.o rpartexp2.o rpcountup.o rpmatrix.o rundown.o rundown2.o s_to_rp.o s_xpred.o surrogate.o usersplit.o vgdist.o xdiss.o xval.o"' had status 127
ERROR: compilation failed for package 'mvpart'
* removing 'C:/Users/jk/Documents/R/win-library/3.1/mvpart'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\jk\Documents\R\win-library\3.1" "D:/mvpart_1.6-2.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘D:/mvpart_1.6-2.tar.gz’ had non-zero exit status
My questions are: Did I do something wrong here - is there a way to install 'mvpart'? Or, is there another package that will do multivariate partitioning, similar to 'mvpart'?

Option 1:
An archive install must be compiled, as it's stored as source code. Probably, you have not installed the R Tools compiler for Windows. Follow the install instructions here.
Once that was done, for me, mvpart installed flawlessly from the downloaded archive:
install.packages("C:/mydownload/path/mvpart_1.6-2.tar.gz", repos = NULL, type = "source")
Option 2:
If Option 1 doesn't get the job done, get the devtools package:
install.packages("devtools")
Use it to get the github version:
devtools::install_github("cran/mvpart")
I believe you'll still need the R tools compiler though

downloading Xcode from either the Apple AppStore or Apple Developer website solved my issues installing mvpart. The app version required iOS 10.13 as of this post, but it was easy to find a compatible older version on the website to download. After you download it, move it to your Applications folder and then open it. After that then the devtools:::install_github() worked for me.

Related

Problems installing GMMAT package into R-Studio v. 1.2.5033 & R-console v.3.6.0

This is the code I have been running: (as suggested)
install.packages (c("devtools", "RcppArmadillo", "CompQuadForm", "doMC",
"foreach", "Matrix", "BiocManager", "testthat"),
repos = "http://cran.r-project.org/")
BiocManager::install(c("SeqArray", "SeqVarTools"))
devtools::install_github("hanchenphd/GMMAT")
I receive the subsequent messages in my console:
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘GMMAT’ Do you want to attempt to
install these from sources? (Yes/no/cancel)
Enter: YES
And then:
ERROR: compilation failed for package ‘GMMAT’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/GMMAT’**
I have attempted to uninstall and re-install R-Studio and R-console, have updated the platforms, installed any necessary packages for R/Macbook, etc. and still cannot seem to fix this issue. Currently using a Macbook so domc is not the issue.
Any help you guys could provide would be great!

Why is install.package() - building the package from scratch?

I installed RStudio and R recently on a new laptop
I installed RTools after I noticed that my "packages" (it's source code) - was being downloaded in a temp. folder under "Users...\AppData\ etc. and I couldn't find the actual package and use them.
The RTools then builds the package from source - I think
This did not happen with my earlier RStudio and R isntalls. The packages were downloaded "cleanly" - I don't remember it going to through the source code build process
> install.packages("caret")
also installing the dependencies ‘nloptr’, ‘lme4’, ‘pbkrtest’, ‘car’
Packages which are only available in source form, and may need compilation of
C/C++/Fortran: ‘nloptr’ ‘lme4’ ‘caret’
Do you want to attempt to install these from sources?
When I say 'y' to this question - it builds it all right.
Versions:
OS: Windows 10
RStudio: 0.99.903
R: 3.3.1
(P.S. I have not been able to install the 'caret' package, the others I could going through this process.)
this worked for me:
I installed the package directly from the windows binary zip file:
LINK <- "https://cran.r-project.org/bin/windows/contrib/3.3/caret_6.0-71.zip"
install.packages(LINK, repos =NULL)
The links to binaries were found at: https://cran.r-project.org/
See under Software > R Binaries

install package on windows ERROR: compilation failed for package 'cldr'

url <- "http://cran.us.r-project.org/src/contrib/Archive/cldr/cldr_1.1.0.tar.gz"
pkgFile<-"cldr_1.1.0.tar.gz"
download.file(url = url, destfile = pkgFile)
Console
>trying URL 'http://cran.us.r-project.org/src/contrib/Archive/cldr/cldr_1.1.0.tar.gz'
Content type 'application/x-gzip' length 2296083 bytes (2.2 MB)
==============================
downloaded 2.2 MB
install.packages(pkgs = pkgFile, type = "source", repos = NULL)
> Installing package into ‘C: / Users / v - xuawan / Documents / R / win -
library / 3.2’
(as ‘lib’ is unspecified)
* installing * source * package 'cldr' ...
** package 'cldr' successfully unpacked and MD5 sums checked
** libs
> ** * arch - i386
Warning:running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-32~1.0/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-32~1.0/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="cldr.dll" ' had status 127
ERROR:compilation failed for package 'cldr'
* removing 'C:/Users/v-xuawan/Documents/R/win-library/3.2/cldr'
Warning in install.packages:running command '"C:/PROGRA~1/R/R-32~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\v-xuawan\Documents\R\win-library\3.2" "cldr_1.1.0.tar.gz"' had status 1
Warning in install.packages:installation of package ‘cldr_1.1.0.tar.gz’ had non -
zero exit status
I tried to install package cldr on windows.
I am wondering if any of you know how to solve above error message
Have you installed RTools?
Choose the right version, which belongs to your R version (it seems you use R 3.2)
From the 127 return code, it looks like you don't have a C++ compiler installed on your path. Have you installed the latest Rtools for Windows? It will give you the C++ toolchain you need.
Try this: install.packages("cldr", type="binary"). I was getting same error message for 'backports' package installation.
The same functions can be found in other packages now available on CRAN. They can be installed with the usual install.packages("cld2") and install.packages("cld3"):
cld2 - https://github.com/ropensci/cld2
cld3 - https://github.com/ropensci/cld3
For a quick comparison based on tweets, see this other answer: https://stackoverflow.com/a/46663823/4124601
I was having the same issue on R Cloud for 'raster' package, it's fixed when I've switched to Desktop R Studio. I've seen Desktop R studio downloads other required packages too before installing the one you wanted. I'm not sure if this's the exact case for you, but worth to try!

Error in in installing an old version of a R package

I tryed to install from file an old version of RgoogleMaps package with this command
install.packages("F://RgoogleMaps_1.1.9.15.tar.gz", repos = NULL, type="source")
but i found this error message:
* installing *source* package 'RgoogleMaps' ...
** package 'RgoogleMaps' successfully unpacked and MD5 sums checked
ERROR: a 'NAMESPACE' file is required
* removing 'C:/Users/Famiglia Mazza/Documents/R/win-library/3.1/RgoogleMaps'
* restoring previous 'C:/Users/Famiglia Mazza/Documents/R/win-library/3.1/RgoogleMaps'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\Famiglia Mazza\Documents\R\win-library\3.1" "F://RgoogleMaps_1.1.9.15.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘F://RgoogleMaps_1.1.9.15.tar.gz’ had non-zero exit status
what can I do? I'm using R on Windows
In R 2.14.0 a requirement was made that all packages had namespaces, but as a transitional arrangement those that didn't would have one automatically generated at install time.
A package R code but without a ‘NAMESPACE’ file will have a default
one created at R CMD build or R CMD INSTALL time, so all packages will
be installed with namespaces. A consequence of this is that
.First.lib() functions need to be copied to .onLoad() (usually) or
.onAttach(). For the time being, if there is an auto-generated
‘NAMESPACE’ file and no .onLoad() nor .onAttach() function is found
but .First.lib() is, it will be run as the attach hook (unless the
package is one of a list of known exceptions, when it will be run as
the load hook).
However, by R 3.0.0 this transitional arrangement was ended:
The transitional support for installing packages without namespaces
(required since R 2.14.0) has been removed. R CMD build will still add
a namespace, but a .First.lib() function will need to be converted.
R CMD INSTALL no longer adds a namespace (so installation will fail),
and a .First.lib() function in a package will be ignored (with an
installation warning for now).
As an exception, packages without a ‘R’ directory and no ‘NAMESPACE’
file can still be installed.
Therefore, I suggest you use an older version of R to run this package. One prior to R 3.0.0 should suffice, and the latest one prior to that is R 2.15.3.

R - devtools Github install fails

Trying to use Hadleys devtools package I am getting a certification error:
install_github("devtools")
Installing github repo(s) devtools/master from hadley
Installing devtools.zip from https://github.com/hadley/devtools/archive/master.zip
Error in function (type, msg, asError = TRUE) :
Peer certificate cannot be authenticated with given CA certificates
Google search tells me that this is a curl issue. I am no nearer.
Using "git" from the command line I can pick up anything I want from github, - I don't get this error. It only appears when I try to connect to github from R.
I am using ubuntu 12.10, libcurl 7.22.0 and R 3.0
Does anyone have an idea what to do to fix this?
Sincerely
H.
This issue is resolved. There was some mismatch between the version of RCurl and the curl library. Re-installing RCurl fixed the problem.
Try
$ git clone git://github.com/hadley/devtools.git
$ R CMD build devtools
$ R CMD install devtools_1.2.99.tar.gz
or just
$ git clone git://github.com/hadley/devtools.git
$ R CMD install devtools
both worked for me on Ubuntu 12.04. Someone else can weigh in on whether there's any difference in building first then installing from tarball or not. I would guess no, but I have no idea
edit:
trying this on os X
* installing to library ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library’
* installing *source* package ‘devtools’ ...
** libs
sh: make: command not found
ERROR: compilation failed for package ‘devtools’
* removing ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/devtools’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/devtools’

Resources