[R] viewing source code

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Tue Jun 19 00:56:17 CEST 2007


Werner:

> could somebody give me a quick hint how to view the
> source code of a function if sole entering of the
> function name does not work?
>
> In particular, I am trying to look at "cd_plot" from
> the vcd package.

Strategy 1: Typing "cd_plot" tells you that it is a generic function
  and "methods(cd_plot)" shows you which methods exist (default and
  formula) which are both non-visible. You can still directly access
  them via "vcd:::cd_plot" (which is the main work horse).

Strategy 2 (preferred, especially if you want to take a closer look):
  Obtain the source package from CRAN. Unpack the tar.gz file and
  look into the vcd/R folder where you will find cd_plot.R containing
  the sources of both methods.

grx,
Z



More information about the R-help mailing list