[R] Adding .R to source file keeps R from reading it?

Duncan Murdoch murdoch at stats.uwo.ca
Fri Sep 22 00:46:07 CEST 2006


On 9/21/2006 5:01 PM, John Tillinghast wrote:
> Hi,
> 
> I'm updating the LMGene package from Bioconductor. "Writing R Extensions"
> suggests
> that all source files (the ones in the R directory) have a .R ending, so I
> added it to the (one) source file.
> The next time I installed and ran R, R didn't understand any of the
> functions.
> I tried various things and eventually went back to the file and dropped the
> .R ending, installed, ran R. It worked!
> For purposes of distributing the package, do I want to leave the name
> without the .R, or add the .R and change something else?

You aren't giving us very much information, but I would guess you edited 
the installed copy of the package rather than the source.  (Where did 
you find the file with the source in it?  If it was in
$(RHOME)/library/LMGene/R, then that's the installed copy, and you 
shouldn't edit it.)  When R installs a package, it copies all the source 
into one file and doesn't put the .R extension on it.  I imagine if you 
try running after renaming such a file, R wouldn't see it.

Your other message about seeing a "help" directory confirms this.

You should get the source to the LMGene package, and make modifications 
to that, or just write your own functions and put them in your own file.

Duncan Murdoch



More information about the R-help mailing list