Error in installing packages from RStudio - r

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.

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

RStudio - RevoScaleR (Windows)

Can this package be used for either (1) RStudio Desktop/Open; and/or (2) RStudio Server (also using SQL Server 2017 Enterprise)?
I'm primarily interested in RStudio Desktop, however can't appear to find anything online after about one hour of research.
When attempting to install the package in RStudio Desktop, I receive the error message:
install.packages("RevoScaleR",dependencies = TRUE, repos = 'http://cran.rstudio.com/')
Installing package into ‘C:/Users/Harvey/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘RevoScaleR’ is not available (for R version 3.5.0)
Thanks in advance.
So you have the R version of 3.5.0. However, RevoScaleR is built on R 3.4.3. You can install any version before 3.4.3 and install the package again. Note that you need Microsoft R Client to be installed and this path can be given to RStudio. Look for the documentation here.
RStudio has a feature to change the version of R without uninstalling your current version. After installing the desired R version, you can go to Tools -> Global Options to change your version.

Error in installing gtools

I am fairly new to R. I have tried to google my question, and tried a few things, to no avail.
I am working on a MAC * High Sierra version 10.13.5
I am working with R * R version 3.5.0 (2018-04-23) -- "Joy in Playing"
I am unable to install the package "gtools", and I don't know what to do to make it work??
install.packages("gtools", type="source")
Warning: unable to access index for repository https://mirrors.sorengard.com/cran/src/contrib:
cannot open URL 'https://mirrors.sorengard.com/cran/src/contrib/PACKAGES'
Warning message:
package ‘gtools’ is not available (for R version 3.5.0)
I have also tried to install from a file saved on my computer, but this did not work either
library(gtools)
Error: package or namespace load failed for ‘gtools’:
package ‘gtools’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
You could try specifying a specific repository, for example:
install.packages("gtools", repos="https://cran.rstudio.com/")
Why are you using install from source? typically to install a package u only need to use the command
install.packages("gtools")
Then it will automatically ask u for a mirror to download from. It seems like "gtools" is available for R 3.5, so try to download it from another mirror and it should work.

R package was installed by version with different internals

On my Win 7 Ent x64 I installed RStudio R-3.4.2.
I installed few packages that I need (RPostgreSQL, sqldf, etc..)
But when I'm executing code, these libraries give me errors:
library(RPostgreSQL)
Error: package ‘RPostgreSQL’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
In addition: Warning message:
package ‘RPostgreSQL’ was built under R version 3.5.0
All of the packages are downloaded from CRAN. RPostgrSQL is 0.6-2 version.
I'm pretty sure that solution is quite simple, but I searched a lot and still cannot find the solution.
How did you install the package RPostgreSQL? If you used
install.packages("RPostgreSQL") on your Windows it installed using binaries, which may have been built using a different R version. In your case, 3.5.0 vs 3.4.2.
Try using install.packages("RPostgreSQL", type="source"). This way your machine will compile the package from source using your version of R, and it should work.
If the package needs C/C++/Fortran compilation, you will als need RTools installed on your machine.
You can try to find all packages installed with the old version R like this:
grep 'Built: R 3.4' /usr/local/lib/R/site-library/*/DESCRIPTION > temp
and then you can uninstall the packages with remove.packages()

Unable to install ggplot2 on Ubuntu 11.10

I am getting the following error when trying to install ggplot2:
> install.packages("ggplot2")
Installing package(s) into ‘/home/dodo/R/x86_64-pc-linux-gnu-library/2.13’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘ggplot2’ is not available (for R version 2.13.1)
I am running Ubuntu 11.10 (oneiric).
Any help is appreciated.
You need R (>= 2.14.0) for this version.
So please go and see the instructions at CRAN to upgrade on Ubuntu to the current R and once you have R 2.14.2 up and running (which is a matter of four or five commands, thanks to the magic of apt-get and friends, upgrade to the current ggplot2.
ggplot2-0.9.0 has an explicit dependency on R >= 2.14 (and an implicit one of R >= 2.14.1). Thus it can not be installed in R version 2.13.1. Perhaps you can get the previous version (0.8.9) from the archives and install that.
You need to install a version that is appropriate to your old version of R or you need to upgrade. To go the first route, you should find a version of ggplot2 in the Archives and then install from source (which is I believe the default for Linux). Perhaps try the UCLA CRAN mirror:
http://cran.stat.ucla.edu/src/contrib/Archive/ggplot2/ggplot2_0.8.9.tar.gz

Resources