
PACKAGES FOR R
This page provides various extensions for the
statistical software R (see www.rprojects.org). Some of them
are available on the CRAN
(Comprehensive R Archive Network)) mirrors. The others are
distributed only on this site and must be installed manually.
Here are instructions to install
the packages, either from CRAN, or manually.
Note that some of the packages below have been written only for
teaching purpose for my students at the Paris Ouest
University and are not designed for production. You are free
to modify or adapt them to suit your own needs. On the other hand, the
packages which have been published on CRAN are intended for a much
wider audience.
clusterCrit

Description

This package computes clusterization quality indices.
It supports 42 internal indices (Calinski_Harabasz,
Dunn, Ray_Turi, etc.) for cluster validation and 14
external indices (Phi, Jaccard, McNemar, etc.) to
compare partitions.
A vignette is included and gives the exact definition of all the indices.
The package is written internally in Fortran and in C
so you will need a Fortran and a C compiler if you want to
compile it from sources. Alternatively, there are already compiled
binary versions on the CRAN mirrors.

Download

To install automatically from a CRAN
mirror, execute the following command from R:
> install.packages("clusterCrit")
Or go to the
clusterCrit
page.

rcqp

Description

This package is a front end in R for the CQP (Corpus Query
Protocol) tool as defined by the CWB (Corpus
Workbench) project (see CWB at
SourceForge).
It lets you send queries to an indexed linguistic
corpus and manipulate the results directly with R, in particular perform
statistics, tests, etc.
A vignette is included and gives various examples.

Download

To install automatically from a CRAN
mirror, execute the following command from R:
> install.packages("rcqp")
Or go to the
rcqp
page.

conics

Description

This package lets you plot 2Dconics (ellipses, hyperbolas, parabolas,
etc.) that is to say curves defined by a quadratic polynomial in two
variables.
Conics can be specified either by the polynomial or by
the associated 3x3 symmetric matrix. There are
functions to compute the various elements (center,
axes, asymptotes, vertices) and options to include
them in the graphic.
Degenerate cases (pairs of lines) are also supported.
A vignette is included and gives various examples. For
instance, the instructions:
library(conics)
v < c(2,2,2,20,20,10)
conicPlot(v, asp=1, sym.axes=TRUE, ax.col="red", ax.lty=2,
col="blue", center=TRUE)
produce the following graphic:

Download

To install automatically from a CRAN
mirror, execute the following command from R:
> install.packages("conics")
Or go to the
conics
page.

diameter

Description

This package calculates the euclidean diameter of a
scatter plot (aka in french as "nuage de points"), that is
to say the largest distance between pairs of points in the
scatter plot. The diameter command works in any dimension.
The code is written internally in Fortran and makes use
of the convex hull of the scatter plot. This makes the
computations very efficient and very fast.
Here is an example where the diameter of 100000 points
with two coordinates
is computed in 12 milliseconds :
> library(fraction)
> set.seed(1)
> m < cbind(rnorm(100000),rnorm(100000))
> diameter(m)
[1] 9.084219
> system.time(diameter(m))
user system elapsed
0.012 0.003 0.014

Download

Download the source code of the
diameter package from this
site. You will need a Fortran and a C compiler to compile
it. If this is the case and if the archive is located in
the current directory of R, you can compile and install
the package
with the following command:
install.packages("diameter_0.4.tar.gz", repos=NULL, method="internal", type="source")
Here is an already compiled binary for Windows:
diameter binary package for
Windows. To install it, execute the following command
from the R console:
install.packages("diameter_0.4.zip", repos=NULL, type="win.binary")

fraction

Description

This package lets you perform symbolic calculations with rational
numbers, that is to say manipulate a quotient like 1/3 as
a fraction rather than as its numerical approximation
0.33333. It is used by the
pivot package
also available on this page.
Here is an example :
> library(fraction)
> a < fract(5,6)
> b < fract(3,4)
> a
5/6
> b
3/4
> a+b
19/12
> ab
1/12
> a*b
5/8
> a/b
10/9
> a > b
[1] TRUE
> a <= b
[1] FALSE
This package has been written for the Master1 course
Mˇthodes Numˇriques at ParisOuest University.

Download

Download the
fraction package from this
site.

pivot

Description

This package implements steps of the Gaussian elimination method
(aka in french as "mˇthode du pivot de Gauss"). It
can perform its calculations numerically or symbolically
using fractions (it relies on the fraction package
also available on this page). It is used by the
simplex package and the
dantzig package
also available on this page.
This package has been written for the Master1 course
Mˇthodes Numˇriques at ParisOuest University.

Download

Download the
pivot package from this
site.

simplex

Description

This package implements the simplex algorithm for linear
optimisation problems subject to linear inequalities
constraints. It
can perform its calculations numerically or symbolically
using fractions (it relies on the fraction package
and the pivot package
also available on this page).
As a convenience, a function can produce the complete
series of tables calculated at each step in LaTeX format.
This package has been written for the Master1 course
Mˇthodes Numˇriques at ParisOuest University.

Download

Download the
simplex package from this
site.

dantzig

Description

This package implements the Dantzig algorithm for quadratic
optimisation problems subject to linear inequalities
constraints. It
can perform its calculations numerically or symbolically
using fractions (it relies on the fraction package
and the pivot package
also available on this page).
As a convenience, a function can produce the complete
series of tables calculated at each step in LaTeX format.
This package has been written for the Master1 course
Mˇthodes Numˇriques at ParisOuest University.

Download

Download the
dantzig package from this
site.

dynprog

Description

This package implements a simple discrete algorithm to
solve optimisation problems by dynamic programming methods.
As a convenience, a function can produce the details of the calculations as
a table in LaTeX format.
This package has been written for the Master1 course
Mˇthodes Numˇriques at ParisOuest University.

Download

Download the
dynprog package from this
site.

