Macaulay2 » Documentation
Packages » RInterface » RFunction » library
next | previous | forward | backward | up | index | toc

library -- load an R package

Description

This loads an R package. It is an RFunction that calls R's library function.

For example, suppose we want to load the abbey dataset with nickel content in a Canadian syenite rock. It is available in the MASS package.

i1 : library "MASS"

--error or time limit reached in conversion of output to net: type 'debugError()' to run it again; will try conversion to string

o1 = MASS, stats, graphics, grDevices, utils, datasets, methods, base

o1 : RObject of type character
i2 : RSymbol "abbey"

--error or time limit reached in conversion of output to net: type 'debugError()' to run it again; will try conversion to string

o2 = 5.2, 6.5, 6.9, 7, 7, 7, 7.4, 8, 8, 8, 8, 8.5, 9, 9, 10, 11, 11, 12, 12, 13.7, 14, 14, 14, 16, 17, 17, 18, 24, 28, 34, 125

o2 : RObject of type double

For the programmer

The object library is an instance of the type RFunction.


The source of this document is in RInterface/doc/functions.m2:54:0.