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

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

Related

Unable to install semPLS package

I'm trying to install the semPLS package on my new MacBook but I get the error:
install.packages("semPLS")
Warning in install.packages :
package 'semPLS' is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
My RStudio is Version R Studio-2022.02.1 Build 461
I've also tried using the earlier version of R 0.99.486 but still have the same problem.
I've used this quite often in the past. It is only when I tried to install the package on my new laptop, that I can't.
I tried looking for the package on cran and cannot find it there. Any advice on how I can locate and install semPLS?
You can install it using the function install_github() from package "devtools"
install devtools:
install.packages("devtools")
library(devtools)
install semPLS:
install_github("cran/semPLS")

Problems when Installing Rpackages arulesViz and H2o in DSX cloud

I'm using RStudio in DSX cloud and trying to install the packages using Packages / Install.
The errors are below:
installation of package ‘arulesViz’ had non-zero exit status
installation of package ‘h2o’ had non-zero exit status
Any solution.
Yes, you're right there is an issue installing "arulesViz". That's because that package is looking for a version of "arules" that won't work with R 3.3.2. What you'll also run into is that installing the latest version of "arules" also won't work since it requires R 3.4 and above.
So, here's what worked for me ... and hopefully for you, too.
1) Install "arules" 1.5-4 (one version away from the current 1.5-5). That's because this version will install on R 3.3.2. Apparently, DSX R is looking for a really old version of "arules" which doesn't like 3.3.2, which is why we have to manually do this:
require(devtools)
install_version("arules", version = "1.5-4")
2) Now, install "arulesViz":
install.packages("arulesViz")
3) Load the package, which will pick up your new "arules" library:
library(arulesViz)
Next, installing "h2o" was pretty straight forward:
install.packages("h2o")
I didn't have a problem installing that one. So, try again. Otherwise, if you could post the error you got then I can investigate further.
For more information on installing libraries on DSX see: https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/importing-libraries.html
Update (April 2019)
IBM Data Science Experience is now called IBM Watson Studio

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

Can I use package 'imputation' in R version 3.0.3?

I am using R version 3.0.3.
I would like to install the package "imputation". I would like to re-run an analysis I used last year in R version 3.0.2.
I also have a new computer so I am re-installing my packages. I would like to install the package "imputation".
install.packages("imputation")
However, I received the following error:
Installing package into ‘\\oxdc/userdata/jolyon.faria/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘imputation’ is not available (for R version 3.0.3)
How can I work around this problem? I thought I could perhaps run two versions of R on the same computer but this may throw up its own problems.
Always check CRAN for package problems:
http://cran.r-project.org/web/packages/imputation/
You might be able to get it working on 3.0.3 or later by installing from source via the source archive.
Or contact the maintainer and ask them if they can fix the problem that caused the removal from CRAN.

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