R: Creating a local library

From MathWiki

Table of contents

Creating a local R library (package)



R documentation using 'help.start()':
Writing R Extensions
R Installation and administration


Install required software

Under Windows, I use Cygwin to have a shell. One needs to use ActivePerl instead of the version that comes with Cygwin. Also one needs to make sure that 'make' is installed with Cygwin.
Make sure the PATH variable is set to include the bin directory of the latest R release:
Under Windows XP: Right-click on 'My Computer'; Click on 'Properties'; Click on 'Advanced'; Click on 'Environment Variables'; Edit the 'Path' variable to include ...

Create initial data structure

1. In R, load functions for library and create skeleton directory structure with
 > package.skeleton( name = "ym" )
2. ....

Install for local use

Using Cygwin or another shell:
cd to the directory that contains the directory for the library (say it's called 'ym')
Use the command: Rcmd INSTALL ym

Creating a publicly accessible repository

Create a directory, e.g. 'R', in a directory that is accessible on the internet (e.g. the directory containing your home page)

Install to repository

Install from repository


Use bioconductor tools for package maintenance, etc.

How to access a repository: http://www.maths.lth.se/help/R/.R/library/reposTools/doc/reposClient.pdf
How to set up a repository: http://www.maths.lth.se/help/R/.R/library/reposTools/doc/reposServer.pdf