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

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

Related

Most recent terra package for R will not compile

I am trying to install the newest version of the terra package, but I keep getting the following errors:
no DLL was created
ERROR: compilation failed for package 'terra'
* removing 'C:/Users/ruben/AppData/Local/R/win-library/4.2/terra'
* restoring previous 'C:/Users/ruben/AppData/Local/R/win-library/4.2/terra'
Warning in install.packages :
installation of package ‘terra’ had non-zero exit status
I don't know if this is my fault or if there is something not right with the package or compiler. Any help on this would be great.
To install the CRAN version from source, you need to install the system dependencies (on OSX and Linux) or, on windows, have the current version of Rtools installed.
On OSX and Windows, you can choose to not install from source. To get the latest released version you would have to wait a couple of days until CRAN has a compiled ("binary") version available for your R version and operating system.
Another way to use a recent version of "terra" on windows is to get the development version from the R-universe:
install.packages('terra', repos='https://rspatial.r-universe.dev')
For more info on installation go the terra github site

Installing zeligverse in R 4.0.2

I'm trying to use plot.ci function in the zelig library but apparently Zelig is not supported with R 4.0.2. I'm trying to see if there is a work around to access these functions or if I just can't use this library until they make the appropriate updates. Please help.
Ethan
Error message below:
> install.packages('zeligverse')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/ethan/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘zeligverse’ is not available (for R version 4.0.2)
It looks like this package has been removed from CRAN's repository, meaning you can't install it like this anymore - you have to install it manually. This is explained on their website, and has download links for manual installation that have been archived:
https://cran.r-project.org/web/packages/zeligverse/index.html
You will also have to install the following dependencies (packages it requires) to install it correctly:
'Amelia', 'MatchIt', 'WhatIf', 'Zelig', 'ZeligChoice', 'ZeligEI'
The Zelig package that is currently available appears to support the function you mentioned. You can install it with:
install.packages("Zelig")

Can't install package 'nutshell' from O'Reilly book 'R in a Nutshell' onto Mac

My first post in an early programming career - any help very welcome.
I am studying R, and using a book called R in Nutshell (O'Reilly). The book is supported by a package that was previously available on CRAN. The package on CRAN has been archived - it is still there though as nutshell_2.0.tar.gz.
I am running MacOS Catalina, R version 3.2.1.(after downgrading from 4.02 to try and solve this issue , without success), and RStudio version 1.3.1093.
When I try to install the package into R via RStudio I have this experience:
packageurl <- "https://cran.r-project.org/src/contrib/Archive/nutshell/nutshell_2.0.tar.gz
install.packages(packageurl,contriburl=NULL,type="source")
Warning in install.packages :
package ‘https://cran.r-project.org/src/contrib/Archive/nutshell/nutshell_2.0.tar.gz’ is not available (for R version 3.2.1)
I have a similar experience if I download the tar.gz file and try to import it directly under Tools/Install Packages.
I am able to install other packages on CRAN successfully.
Many thanks
Up front, I'm doing this on windows and not on macos, but the packages here have no compiled code so there should be few if any differences. Also, I tested on R-4.0.2; I don't think this will be a problem, because these packages appear to have been last-updated in 2012, so if they install on my 4.0.2, then they are likely to work on every version of R since then (including your 4+ year-old R-3.2).
download.file("https://cran.r-project.org/src/contrib/Archive/nutshell.audioscrobbler/nutshell.audioscrobbler_1.0.tar.gz", "nutshell.audioscrobbler_1.0.tar.gz")
download.file("https://cran.r-project.org/src/contrib/Archive/nutshell.bbdb/nutshell.bbdb_1.0.tar.gz", "nutshell.bbdb_1.0.tar.gz")
download.file("https://cran.r-project.org/src/contrib/Archive/nutshell/nutshell_2.0.tar.gz", "nutshell_2.0.tar.gz")
install.packages("nutshell.audioscrobbler_1.0.tar.gz", repos = NULL)
install.packages("nutshell.bbdb_1.0.tar.gz", repos = NULL)
install.packages("nutshell_2.0.tar.gz", repos = NULL)
I tried reproducing installation from archive. I got error that dependencies of this package are not available.
ERROR: dependencies 'nutshell.bbdb', 'nutshell.audioscrobbler' are not available for package 'nutshell'
* removing 'C:/Program Files/R/R-3.6.2/library/nutshell'
Warning in install.packages :
installation of package ‘D:/Profile/maszpa1/Desktop/nutshell_2.0.tar.gz’ had non-zero exit status
Did you get the same error? If yes, then did you try to install them and try again?
As per the accepted answer, the solution was to install the missing dependent packages first, then the Nutshell package.
I was then able to update to R4.02
audioscrobbler_1.0.tar.gz
nutshell.bbdb_1.0.tar.gz
nutshell_2.0.tar.gz

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!

R - Installing package with remotes::install_github ask for higher version of the dependencies which BiocManager::install() can not find

I need to install few packages that should be installed with remotes::install_github() like
"acidgenomics/basejump" or "satijalab/seurat".
During the installation, it need to upgrade few other packages version. The BiocManager::install program cannot find those versions and I had to install those dependencies packages version with:
R CMD INSTALL IRanges_2.20.2.tar.gz
Then other packages, that use the same packages stop working. like DESeq2,
I get the error:
Error: package or namespace load failed for ‘DESeq2’:
objects ‘rowSums’, ‘colSums’, ‘rowMeans’, ‘colMeans’ are not exported by 'namespace:S4Vectors'
I found few answers that say it happen (like url)
remotes::install_github() isn't picking up the correct Bioconductor
devel repos, whereas installing with BiocManager::install() does work
as expected.
we have the R 3.6.0 installed as a module and a lot of users uses the same R version. I need all packages to work for everyone.
How can I make all variety packages versions to work?
Finally, I install new version of R 3.6.3 with Bioconductor 3.10 and all the packages install right.

Resources