Error in installing gtools - r

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.

Related

Tidyverse not installing

I'm having a bit of a pickle right now with the package tidyverse, that I need for an assignment on layering maps. I tried installing the package using install.packages("tidyverse") and install.packages ("tidyverse", dependencies = TRUE) but when I ran library(tidyverse) it wasn't installed. I searched online and found that I had an older version of RStudio IDE so I uploaded the latest version (1.3.1056).
After installing the newest version, I reinstalled the package but R tells me the following:
"Rtools is required to build R packages but is not currently
installed".
So, I did it, but the R tells me Rtools package is not available for R version 3.5.3.
What can I do to use tidyverse?
It could be a permissions issue, try setting the directory for where you install R packages/libraries on your computer using libpaths. I have to do this on my work laptop because the university has it set up to store things like this in a tempporary directory on the remote server which isn't desirable.
.libPaths("C:/R")
.libPaths()

R 3.5 package ‘lattice’ was installed by an R version with different internals

I updated R 3.4.4 to R 3.5.0 today. And my package cannot pass R CMD check anymore. It fails at checking whether package can be installed ... ERROR.
In another hand my package works, I can install it and use it as long as I don't check it.
The error is the following:
Error: package or namespace load failed for ‘sp’:
package ‘lattice’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
Error : package ‘sp’ could not be loaded
I tried to reinstall lattice these ways:
sudo apt-get --reinstall install r-cran-lattice
or
remove.packages("lattice", lib="~/R/x86_64-pc-linux-gnu-library/3.5")
install.package("lattice")
The package lattice is installed correctly in both cases. But it does not solve my problem. Also I ensured to have a single version of lattice removing either the r-cran one or the self compiled version. Nothing works.
Edit By the way I can do library(sp) or library(lattice) it works. But not with R CMD check
The error message tells you that the binary you are attempting to install comes from an insufficient / incompatible R version.
Two fixes:
Install from source as you did. After that check with AP <- available.packages() that you really only have one.
Use the correct binarie: read this README at CRAN and switch to Michael's 'R 3.5' repos. Many of us have been doing that for weeks.
Lastly, the r-sig-debian list is a friendly place for these questions and more. Subscribe first so that you can post.

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()

Error while running a shiny app on ubuntu

I have made a shiny app which works fine on windows, but when I tried running the same on my ubuntu system the app exists abruptly and I get following error
Loading required package: TTR
Version 0.4-0 included new data defaults. See ?getSymbols.
Error in library(rstudio) : there is no package called ‘rstudio’
After this I tried installing the 'rstudio' package and I am getting the following message:
Warning in install.packages :
package ‘rstudio’ is not available (for R version 3.2.1)
My R version is: 3.2.1 and my RStudio version is: 0.99.467
Note: I am new to ubuntu and the only reason I shifted to ubuntu, was to to use shiny-server.
The rstudio package comes with the installation of RStudio (Desktop or Server). If you need to use the rstudio package, you probably need to install RStudio (Dekstop or Server version).
You can do that from here:
https://www.rstudio.com/products/rstudio/download-server/
That said, I'm not clear on why you would need to load the rstudio package.
That is because there is no package called rstudio (at least not on CRAN anyways). Either there is a typo and you really meant the rstudioapi package, or on your windows system you actually did install a package named rstudio that, however, was distributed from another source other than CRAN. I'd suggest try removing the line library(rstudio) and see if it works.

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