Most recent terra package for R will not compile - r

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

Related

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

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.

install quantstrat for R latest R version ()

I would like to install a package when using the latest R version in RStudio.
In particular the quantstrat package
Is that possible?
This is the R latest version I have 3.4.1
my error message:
Warning in install.packages :
package ‘quantstrat’ is not available (for R version 3.4.1)
Because quantstrat build-fail at R-Forge, you can't get the pre-build file(.tar.gz). You can get the code from github and build by yourself.
install.packages("devtools")
require(devtools)
install_github("braverock/blotter") # dependency
install_github("braverock/quantstrat")
Can you provide the installation code that produced that error message? Are you trying to install it from CRAN?
That doesn't appear possible.
A post from 2014 states it's not on CRAN
quantstrat is a R package ... still under heavy development and can’t be installed from CRAN yet. You can install it from source and the process is straightforward.
It's not on the current list of available CRAN packages
It's R-Forge page states the current version 'Failed to build'.
You could download the previous version (and its dependency) from R-Forge at
http://download.r-forge.r-project.org/bin/windows/contrib/3.2/quantstrat_0.9.1739.zip and
http://download.r-forge.r-project.org/bin/windows/contrib/3.2/blotter_0.9.1741.zip
(or get the Linux tar.gz files). Assuming they're saved in your personal Downloads folder, install it in R with
install.packages("~/Downloads/blotter_0.9.1741.zip", repos = NULL)
install.packages("~/Downloads/quantstrat_0.9.1739.zip", repos = NULL)
According to that first link, you'll need to install these prereqs first, if they're not already:
install.packages("FinancialInstrument")
install.packages("PerformanceAnalytics")
install.packages("foreach")
Edit: see the comment below from #brian-g-peterson for how the current deployment avenue uses GitHub. https://github.com/braverock/quantstrat

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

Error in installing packages from RStudio

I have been trying to install the package "doby" from RStudio (ver 0.98.501 ) on ubuntu 13.04 but it keeps throwing the following warning and the package does not get installed.
Warning in install.packages :
package ‘doBy’ is not available (for R version 2.15.2)
I have followed all the instructions given here :
http://www.r-bloggers.com/installing-r-packages/
Can someone please suggest where I might be going wrong ?
If you are on Ubuntu, please see this README for Ubuntu from CRAN --- it will allow you to get to the current version of R (today 3.0.2, in a few days 3.0.3) with mininal effort.
Once you have a current R version, getting the doBy package (which depends on it) installed is a piece of cake too.
If however you prefer to stay with your version of R, you can manually fetch an older version of doBy from its CRAN archive. Download to, say, /tmp and run R CMD INSTALLby hand on it.
From http://cran.r-project.org/web/packages/doBy/index.html, package doBy depends on R version 3.0 and above. Your R version is 2.15.2. You will need to install a later version of R, and then change the settings in Rstudio to target the updated version.

Resources