[R] Help with the internal functions

Duncan Murdoch murdoch at stats.uwo.ca
Mon Aug 10 23:23:26 CEST 2009


Kaiyu Shen wrote:
> Hi, folks:
> I have used R for some time and have not explore deep inside the codes
> of the packages.
> Today, I try to modify some code in a package of arrayQuality (I do not
> think it matters which package it is).
> There is a function called maQualityPlots and I use fix(maQualityPlots)
> that I can view and edit the code of this function.
> However, there is another function qpMAPlots that I want to edit, 
> 1. I type in ?qpMAPlots, it says:
>
> Internal functions       package:arrayQuality       R Documentation
>
> Internal arrayQuality functions
>
> Description:
>
>      Internal arrayQuality functions
>
> Details:
>
>      These are not to be called by the user.
>
>
> (END) 
>
>
> 2. I try to fix(qpMAPlots) and it gives me:
> function()
> {
> }
>
> 3. I type in getAnywhere(qpMAPlots), it shows the code, but how should I
> edit it?
>
> Does anybody have idea of what should I do?
> I have no prior experience on editing the codes of an existed package so
> please some body could help me with this.
>   

You should get the source to the package and edit that.  It may have 
comments in the code explaining why things were done a certain way; you 
should certainly add comments explaining your changes.  Installing the 
package from source is described in the Writing R Extensions manual.  
It's pretty easy, once you have the tools available; on Linux those are 
often already there, and on Windows, you'll need to download some.  
MacOS is a bit of both.

Duncan Murdoch




More information about the R-help mailing list