2

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..

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
Guenzet
  • 35
  • 5

2 Answers2

2

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 ...

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • When I try this I get an error in the url: url(sprintf("%s/src/contrib/Meta/archive.rds", repos), "rb"): invalid 'description' argument – Guenzet Feb 17 '15 at 21:29
  • results of `getOption("repos")` and `packageVersion("devtools")` ? – Ben Bolker Feb 17 '15 at 21:34
  • > getOption("repos") CRAN CRANextra "http://cran.ma.imperial.ac.uk" "http://www.stats.ox.ac.uk/pub/RWin" > packageVersion("devtools") [1] ‘1.7.0’ – Guenzet Feb 17 '15 at 21:39
  • it gives a similar error to before. error in url url(sprintf("%s/src/contrib/Meta/archive.rds", repos), "rb"): unsupported URL scheme – Guenzet Feb 18 '15 at 01:19
  • I've also tried this. url <- "http://cran.r-project.org/src/contrib/Archive/RecordLinkage/rlandscape_1.0.tar.gz" pkgFile <- "rlandscape_1.0.tar.gz" download.file(url = url, destfile = pkgFile) install.packages(c("spatstat", "deldir", "gWidgets","gWidgetsRGtk2")) install.packages(pkgs=pkgFile, type="source", repos=NULL) ***here an error saying program can't start because libatk-1.0-0.dll is missing from your computer. unlink(pkgFile) – Guenzet Feb 18 '15 at 01:38
  • I think your repository default is missing an `http://` at the front. How did you get it? – Ben Bolker Feb 18 '15 at 02:05
  • I think the problem you're having with `libatk-1.0.0-dll` is a separate problem with `RGtk`/`gWidgetsRGtk2` -- have you really successfully installed and loaded that package? – Ben Bolker Feb 18 '15 at 02:18
  • Yes, gWidgetsRGtk2 did install and load. In full: 1. url <- "http://cran.r -project.org/src/contrib/Archive/rlandscape/rlandscape.1.0.tar.gz" 2. pkgFile <- "rlandscape_1.0.tar.gz" 3. download.file(url = url, destfile = pkgFile) 4. install.packages(c("spatstat", "deldir", "gWidgets", "gWidgetsRGtk2")) 5. install.packages(pkgs=pkgFile, type="source", repos=NULL) At this point I get the libatk-1.0.0-dll error. Indeed last thing is 6. unlink(pkgFile) – Guenzet Feb 18 '15 at 11:11
1

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.

ahmohamed
  • 2,920
  • 20
  • 35
  • I have installed all the dependencies, how do I use the R CMD INSTALL command? thanks – Guenzet Feb 17 '15 at 21:19
  • First, download the package. From Terminal, navigate to the folder where you saved the file and write `R CMD INSTALL rlandscape_1.0.tar.gz ` – ahmohamed Feb 17 '15 at 21:25
  • I should have mentioned, I'm using Windows. – Guenzet Feb 17 '15 at 21:31
  • See [this answer](http://stackoverflow.com/questions/4739837/how-do-i-install-an-r-package-from-the-source-tarball-on-windows) for instructions. – ahmohamed Feb 17 '15 at 21:40