Install the Package That Has Been Removed from the Cran Repository Easily

Installing a Package Removed from CRAN

Besides installing from the CRAN mirror repo, another option is

remotes::install_version("DMwR", version="0.4.1")
  • for this method, you do have to look up the last version in the archive directory (would probably be scrapeable if you wanted to write the code)
  • as with remotes::install_github("cran/<package>"), you will be installing from source, which means that if the package or any of its dependencies have compiled components (in this case it doesn't appear so), you'll need to have development tools (compiler etc.) installed on your system

A quick word of caution:

  • this will work well if packages have been archived recently, and if the reason for archiving was because the CRAN maintainers are being fussy (that's their prerogative);
  • however, a package may have become incompatible with the rest of the current R ecosystem (R version, dependencies) since its last update - in which case you may find yourself in dependency hell trying to install it (or, worse, your results may be unreliable).

How do I install a package that has been archived from CRAN?

The package has been archived, so you will have to install from an archive.

I know this because the package home page at http://cran.r-project.org/web/packages/RecordLinkage/index.html tells me:

Package ‘RecordLinkage’ was removed from the CRAN repository.

Formerly available versions can be obtained from the archive.

Archived on 2015-05-31 as memory access errors were not corrected.

By following the link to archives (http://cran.r-project.org/src/contrib/Archive/RecordLinkage) I get a list of all old versions:

[   ]   RecordLinkage_0.3-5.tar.gz  12-Sep-2011 18:04   688K     
[ ] RecordLinkage_0.4-1.tar.gz 12-Jan-2012 09:39 676K

So now I know the version number of the most recent version. The way forward is to download the tarball, install all package dependencies and then install the package from the local downloaded file.

Try this:

# Download package tarball from CRAN archive

url <- "http://cran.r-project.org/src/contrib/Archive/RecordLinkage/RecordLinkage_0.4-1.tar.gz"
pkgFile <- "RecordLinkage_0.4-1.tar.gz"
download.file(url = url, destfile = pkgFile)

# Expand the zip file using whatever system functions are preferred

# look at the DESCRIPTION file in the expanded package directory

# Install dependencies list in the DESCRIPTION file

install.packages(c("ada", "ipred", "evd"))

# Install package
install.packages(pkgs=pkgFile, type="source", repos=NULL)

# Delete package tarball
unlink(pkgFile)

Note:

This will only work if you have the build tools installed on your machine. On Linux this will be the case. But on Windows you will have to install RTools if you don't have it already. And on OS X (Mac) you will have to install XCode and the associated command line tools.

Why was package 'epicalc' removed from CRAN?

It looks most of the material from epicalc has been moved into epiDisplay.

The epiDisplay package information says:

Package for data exploration and result presentation. Full 'epicalc' package with data management functions is available at the author's repository.

(although it doesn't give a link).

devtools::install_version("epicalc",version="2.15.1.0")
install.packages("epiDisplay")
library("epicalc")
library("epiDisplay")
c1 <- ls("package:epicalc")
d1 <- ls("package:epiDisplay")

In epicalc but not epiDisplay:

setdiff(c1,d1)
## [1] "addMissingRecords" "adjust" "auc"
## [4] "be2ad" "detachAllData" "expand"
## [7] "fillin" "keepData" "label.var"
## [10] "lagVar" "markVisits" "merge.lab"
## [13] "pack" "print.summ" "recode"
## [16] "recode.default" "recode.is.na" "ren"
## [19] "rename" "rename.default" "rename.pattern"
## [22] "rename.var" "sortBy" "tally.events"
## [25] "unclassDataframe" "use" "zap"

In epiDisplay but not epicalc:

setdiff(d1,c1)
## [1] "print.summ.data.frame" "print.summ.default" "summ.data.frame"
## [4] "summ.default" "summ.factor" "summ.logical"

Edit:

Per the author of epicalc:

‘epicalc’ has disappeared from CRAN. It has been archived by R-core team based on my request. The reason is that CRAN has set up a policy not to allow any package to do anything on .GlobalEnv while epicalc does that extensively.

They go on to say:

WHICH ONE IS BETTER? ‘epicalc’ or ‘epiDisplay’

For those who are familiar with epicalc, without these database functions, you need to get back to usual plain R functions. That will slow you down substantially, especially during the data cleaning and manipulation. I recommend that you should install epicalc from our website (as shown above) and don’t borther about ‘epiDisplay’ For R users who have never used epicalc and do not want to learn epicalc database functions, ‘epiDisplay’ is straightforward and should still be very useful in data exploration and result display.

CRAN package release feedback: You write information messages to the console that cannot be easily suppressed

We cannot see you code as you have not provided a reproducible example---so there is some guessing on my end involved---but it likely means you have one of

print()
cat()

in your code, just as the text says. And instead of cat("Hello to my package\n") you can also say packageStartupMessage("Hello to my package\n") for which the corresponding function suppressPackageStartupMessages() can be used to suppress.

For example:

> packageStartupMessage("Welcome to my package")  
Welcome to my package
> suppressPackageStartupMessages(packageStartupMessage("Welcome ..."))
>

The second one is suppressed, the first one isn't. You need to find what prints to the console in your package (or any library it uses) and change it.

Similarly, message() can be suppressed, and warning() can be controled via warning levels.

The r-package-devel list is an excellent place for these questions, and the list archives will have examples of this too.

R: make not found when installing a R-package from local tar.gz

what do you need is to update the Rtool, here is the link I had the same issue before once you update it will work.

How to install a package not located on CRAN repository?

You will need R version 3 for this, which you can get here for example:
http://cran.cnr.berkeley.edu/bin/windows/base/R-3.0.1-win.exe

Then open R and type:

install.packages("devtools")
require(devtools)
install_url("http://www.omegahat.org/RGoogleTrends/RGoogleTrends_0.2-1.tar.gz")
require(RGoogleTrends)
ls("package:RGoogleTrends")

You may get few warnings in the process. Ignore them. you should then be able to use the package.



Related Topics



Leave a reply



Submit