Re: [R] Possible to get a definition of a function from a package to use without invoking the package?

From: Gabor Grothendieck <>
Date: Wed 28 Jun 2006 - 05:12:18 EST

You can use


instead of mod, e.g.

   12 %% 5

see ?"%%"

You can use

   unlist(gregexpr(pat, string, fixed = TRUE))

instead of instring(pat, string). If you just want the first occurrence use regexpr instead of gregexpr.

On 6/27/06, Waichler, Scott R <> wrote:
> Hi,
> I often use the mod() and instring() functions that are available in the
> clim.pact package. This package has a lot of dependencies, including
> installation of netCDF, and I haven't yet been able to get
> library(clim.pact) to work on a Mac OS 10.4.6. A previous request for
> help with the Mac problem yielded no results, so now I wonder if I could
> just extract the definitions for the couple of functions that I need and
> save them in my own file of R functions. I'm pretty sure that mod() and
> instring() are very basic and don't have any exotic dependencies. I did
> find an alternative mod() in the new matlab package, and that's fine.
> Now I just need another way to get the instring() functionality.
> Thanks,
> Scott Waichler
> Pacific Northwest National Laboratory
> scott.waichler _at_
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!
> mailing list PLEASE do read the posting guide! Received on Wed Jun 28 05:30:16 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 28 Jun 2006 - 06:12:42 EST.

Mailing list information is available at Please read the posting guide before posting to the list.