FactoMineR

Installing FactoMineR

FactoMineR is a package for R that offers various method for analysing categorical data via an interface that is easily learnt. The installation, however, is not quite as easy, since the procedure documented on the web site of FactoMineR has alot of problems. Here is a quote of the webbpage:

------------------------
Install FactoMineR

  * Download the R software at the following adress: http://lib.stat.cmu.edu/R/CRAN/ (animated tutorial).

  * Download the the FactoMineR package: you can download the Package from the CRAN or from this site:

        1) Windows version,
        2) Linux version.

  *  Download FactoMineR in your R session with writting the following line code: library(FactoMineR).

Install the FactoMineR GUI

  * Download Open the R software.
  * Copy and paste the following line code: (be careful, you have to be connected to the internet):
    source("http://factominer.free.fr/install-facto.r").

install-facto

  *  Answer "yes" to all the questions.
-------------------------------

The above recommendations completely ignores that operating system vendors offer pre-compiled and nicely integrated packages that can be installed, and in the future automatically upgraded to newer versions, just like any other free software package by a simple command, like:

# apt-get install r-cran-rmdr

In addition, it has the following problems:

While the recommended way of installing a cran package (install.package() within R) also works for FactoMineR, that installation does not add the menu items in Rcmdr.

So from having nothing R installed to get a working FactoMineR installation (including the FactoMineR menus in R commander) which can be automatically upgraded to newer versions, do like this (replace "foo" with your username):

# apt-get install r-cran-rmdr r-base-dev
# chown -R foo:root /usr/lib/R
# chown -R foo:root /usr/local/lib/R
$ R
> install.package(FactoMineR)
> chemin = paste(.find.package(package="Rcmdr")[1],"/etc",sep="")
> menu = readLines(con=paste(chemin,"/Rcmdr-menus.txt",sep=""))
>  if (any(i <- grep("Add menu for FactoMineR" ,menu))){
    lig1 = grep("Add menu for FactoMineR",menu)
    lig2 = grep("End add menu for FactoMineR",menu)
    if (lig2 == length(menu)) menu = menu[1:(lig1-1)]
    else menu = menu[c(1:(lig1-1),(lig2+1):length(menu))]
  }
> add.menu.facto = readLines("http://factominer.free.fr/add-menu-facto.txt")
> facto = readLines("http://factominer.free.fr/Rcmdr-facto.r")
> writeLines(facto,con=paste(chemin,"/Rcmdr-facto.r",sep=""))
> menu = c(menu,add.menu.facto)
> writeLines(menu,con=paste(chemin,"/Rcmdr-menus.txt",sep=""))
> library(Rcmdr)

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: 2007-11-01