Install a R package in TXM / Installer un package R dans TXM

ENGLISH

To install a R package in TXM:

  • switch to the R perspective: using the “R” perspective button in the toolbar or the “View > Perspectives > R” menu entry
  • create a new R session: click on the New session button in the toolbar
    → a new “sessionX.R” script file is opened in a text editor
  • write or copy the following R code in the script:
    install.packages("name-of-my-package")
  • run the code: click on the “Run” button in the toolbar
    → the Console display installation messages and finish with: Rserve>* DONE (name-of-my-package)

Should the install process abort for some reason, you can try to install 'name-of-my-package' from R directly:

  • under Windows, TXM uses its own R environment, so you need to run that R to install the package
  • under Mac OS X and Linux, TXM uses the installed R, so you need to install your R package as usual
  • when you start TXM again, it will be able to use the freshly installed packages through the R it communicates with (with the library command).

To use your R package in TXM, you need to load it with the 'library' R command:

  • switch to the R perspective: using the “R” perspective button in the toolbar or the “View > Perspectives > R” menu entry
  • create a new R session: click on the New session button in the toolbar
    → a new “sessionX.R” script file is opened in a text editor
  • write or copy the following R code in the script:
    library(name-of-my-package)
  • run the code: click on the “Run” button in the toolbar

If you want to always load your package at TXM startup, you can add your package loading instructions into the '.rprofile' standard R startup file (Warning: please see ticket #866).

TXM always automatically load the following packages:

  • textometry
  • FactoMineR

FRANÇAIS

public/installer_un_package_r_dans_txm.txt · Dernière modification: 2014/06/16 16:35 par slh@ens-lyon.fr