Re: [R] how to use the function from another package

From: Paul Roebuck <roebuck_at_odin.mdacc.tmc.edu>
Date: Wed 10 Aug 2005 - 04:22:39 EST

On Tue, 9 Aug 2005, Peter Yang wrote:

> I am trying to write a package(A) for myself and need to use a
> function from another package(B) which is in R already(need to install
> it before use). Could anyone tell me how to implement that? Also I
> hope that my package gives an ERROR message(something like "STOP,
> please install package B first") if the package B is not installed
> yet. It is my first time to write a package. Thanks very much for
> your help.

In your package's DESCRIPTION file, you should have an entry that lists your package dependencies. Simply add the other package there as well.

For example, to support the current version of R and a package named foo, the entry would look like this:

    Depends: R (>= 2.1.1), foo



SIGSIG -- signature too long (core dumped)

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Aug 10 04:28:05 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:11:48 EST