Installing package webr failed - r

I am having issues installing the 'webr' package in R, which is necessary to use the PieDonut function to make beautiful multi-level pie charts.
I have followed the instructions on this website, which demonstrates how to install the packages and work with it. https://rpubs.com/cardiomoon/398623
However, when installing the package 'webr' it says:
Failed to install 'webr' from GitHub:
(converted from warning) package ‘mnormt’ is not available (for R version 3.6.2)
It is necessary to install it from GitHub because the CRAN version does not include the PieDonut function.
I already tried to search for older versions of the package and made sure that my R version was up to date, however this did not result in any progress.
Does anybody have any suggestions to help me use this package?

You are on R 3.6.2, whereas mnormt requires R 4.0.0 or higher.
Installing an older version of the package can go from easy to "I want to jump out the window" difficult. If you go to the package archive you can find a version that will not depend on newer version of R than you have. You can install it from source with, if I remember correctly, something along the lines of
install.packages("https://cran.r-project.org/src/contrib/Archive/mnormt/mnormt_1.5-7.tar.gz",
repos = NULL,
type = "source")
Assuming all its dependencies do not require something you do not have (i.e. R >= 4.0.0), it should work. If not, you would have to install mnormt dependecies by hand as well, as well as any potential dependencies of dependencies. See what I mean by jumping out of the window?
Alternatively, upgrade your R and you avoid these kinds of problems (in 99.9 % of the time).

Related

Why is R unable to access index for repository of bioconductor

When trying to install bioconductor (for installing phyloseq package) I get several warning and error messages
I got a new harddrive few days ago so I had to reinstall all programs including R with all the packages I usally need. Everything worked fine until I tried bioconductor.
I am using the rcommended code which worked out for me before:
source('http://bioconductor.org/biocLite.R')
biocLite('phyloseq')
The error message I get is:
Using Bioconductor 3.7 (BiocInstaller 1.30.0), R 3.6.0 (2019-04-26).
installation path not writeable, unable to update packages: cluster,
nlme Updating packages 'bipartite' Warning: unable to access index for
repository
https://bioconductor.org/packages/3.7/bioc/bin/windows/contrib/3.6:
cannot open URL
'https://bioconductor.org/packages/3.7/bioc/bin/windows/contrib/3.6/PACKAGES
So apparently there are several problems?
Some packages cant be updated due to wrong libpath and
R is not able the open the bioconductor hompage
Thanks for your suggestions!
Bioconductor is tied to particular versions of R. You're trying to use a version of Bioconductor (3.7) on a version of R (3.6) that does not match. There is a map between versions, but the underlying problem is that you're using your R-3.5 libraries hoping that they'll work in R-3.6. You should instead 'start over' with an R-3.6 specific installation. In addition, 'BiocInstaller' has been replaced with BiocManager; your 'recommended code' is out of date, as shown on package landing pages.
If you want to continue using your previous library installation (note that this is a one-way street -- you're giving up on your usable R-3.5 installation), try removing ALL versions of the BiocVersion and BiocInstaller packages. .
remove.packages(c("BiocVersion", "BiocInstaller")) # repeat 'till all removed
Either starting with a new library or after removing previous versions of BiocVersion / BiocInstaller, install BiocManager from CRAN
install.packages("BiocManager")
and go about your business
BiocManager::install("phyloseq")
Make sure to validate your installation, so that you do not mix packages from different Bioconductor versions
BiocManager::valid()
Check out current package landing pages, e.g., for phyloseq, or the installation page.

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.

installing an archived package

The package is available on this website.
http://cran.r-project.org/src/contrib/Archive/rlandscape/
When I use:
install.packages("rlandscape",
repos = "http://cran.r-project.org/src/contrib/Archive/rlandscape/",
type="source")
I get the following error:
package 'rlandscape' is not available (for R version 3.1.2)
I have tried older versions too but no luck..
The devtools package has a function that can install archived versions. Try:
library("devtools")
install_version("rlandscape",version="1.0",
repos="http://cran.r-project.org")
(You should be able to use repos=getOption("repos")["CRAN"] instead, but it looks like your repos option is slightly messed up, i.e. the URL is missing the http://.)
(The repos argument is necessary to work around what I think is a glitch in install_version, i.e. it assumes that repos is a length-1 character vector.)
This should, I think, also automatically install appropriate dependencies -- although it's a bit of a catch-22 if they are in the CRANextra repository for Windows, since that has to be suppressed in order to get install_version to work ...
It may also be the case that install_version automatically assumes that you want the package and all dependencies installed as source (not binary) installations, in which case you will need to have compilation tools installed. The rlandscape package doesn't actually have any compiled code included, but its dependencies do ...
This is an old (archived) package that is no longer supported. If you really need it, you can install it using R CMD INSTALL but you need also to install all its dependencies manually.
Installing your desired package gave me the following:
>R CMD INSTALL ~/Downloads/rlandscape_1.0.tar.gz
* installing to library ‘/Users/mohamedahmed/Rlibs’
ERROR: dependencies ‘spatstat’, ‘deldir’, ‘gWidgets’, ‘gWidgetsRGtk2’ are not available for package ‘rlandscape’
* removing ‘/Users/mohamedahmed/Rlibs/rlandscape’
I am not sure all dependencies are still available on CRAN, but it seems to be challenging task.

Use cloud as mirror to download R package

I'm using R version 2.15.1 on Mepis 12.
I was trying to install a package called languageR (along with 3 more, see below), used in the book Analyzing Linguistic Data (R.H.Baayen). The problem is this:
> install.packages("languageR",repos = "http://cran.r-project.org")
Installing package(s) into ‘/home/nalerive/R/x86_64-pc-linux-gnu-library/2.15’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘languageR’ is not available (for R version 2.15.1)
Upgrading is not really an option, unless it's really necessary to do so (I want to work with lme4 as well, which I already have, but have no experience with it in this R version yet).
So, I sent an email to the author and asked him what to do. His reply was:
If you select the cloud as mirror, then you should be able to install
languageR, and separately e1071 (it lives on CRAN), the successor of
design (rms), and ape (it also lives on CRAN)
My question is, then, what is cloud mirror and where can I find it?
Any help would be highly appreciated!
languageR has R (≥ 3.0.2) in its Depends (see the CRAN page). Preferably you update R, but alternatively you can install from an older source.

How to force older packages to install on newer versions of R?

I cannot install proj4string into my current version of R (2.15.1):
Warning message:
package ‘proj4string’ is not available (for R version 2.15.1)
I assume this is because 2.15.1 is fairly new and the package just hasn't been updated. Is there a general mechanism for forcing R to install an older version of a binary package (realizing that there may be bugs that result)?
(upgraded from a comment)
Download the relevant package (zip, tarball, whatever) from the archives and install it locally, e.g.
install.packages("proj4string_x.y.z.zip",repos=NULL)
(this is not literal: x.y.z represents the package version)
sorry to bump this post again, but i had the same problem . then i found that I can use the following lines for the package:
install.packages("devtools")
devtools::install_github("slowkow/ggrepel")
replaced "slowkow/ggrepel" by the package and github repo.
What i noticed that many packages on github will have details to that. Hope that helps.
You can use install_version from the package devtools to install a specific package version.
To find the package version:
Search for the CRAN page of the package. E.g. for ggmap it is https://CRAN.R-project.org/package=ggmap
Check the archived packages. See heading "Downloads" and "Old Sources:"
Example code for package ggmap
devtools::install_version(
"ggmap",
version = "2.6",
repos = "http://cran.us.r-project.org"
)

Resources