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

2006-09-22 Thread Izmirlian, Grant \(NIH/NCI\) [E]
So...are you trying to modify a contributed package by adding a *.R file
to the 'R' subdirectory in the package?  One thing to consider besides
the previous tip is that the package might be using a NAMESPACE, which
lives in the package root directory (one directory up from the 'R' 
subdirectory).  If so, then you must add the name of your function
to the argument list of the call to 'export' in the NAMESPACE file

e.g.  export(sortgenes, pvalues, MyFunction)


-Original Message-
From: John Tillinghast [mailto:[EMAIL PROTECTED]
Sent: Thu 9/21/2006 9:55 PM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] Adding .R to source file keeps R from reading it?
 
Yes, this was exactly the problem: I was using the unzipped package, not the
source.
Now it works!

-- Forwarded message --
From: Deepayan Sarkar [EMAIL PROTECTED]
Date: Sep 21, 2006 2:58 PM
Subject: Re: [R] Adding .R to source file keeps R from reading it?
To: John Tillinghast [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch

On 9/21/06, John Tillinghast [EMAIL PROTECTED] 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?

I'm guessing that the source you are working on has been obtained by
unzipping the windows binary zip file. Despite appearances, that is
not the source code. For the proper source code, download the file
that's marked as source. In this case,

http://bioconductor.org/packages/1.8/bioc/html/LMGene.html

clearly labels the following as Source (and the corresponding zip
file as Windows Binary)

http://bioconductor.org/packages/1.8/bioc/src/contrib/LMGene_1.0.0.tar.gz

This likely answers your other question as well.

-Deepayan

[[alternative HTML version deleted]]

__
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
and provide commented, minimal, self-contained, reproducible code.


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

2006-09-21 Thread John Tillinghast
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?

[[alternative HTML version deleted]]

__
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
and provide commented, minimal, self-contained, reproducible code.


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

2006-09-21 Thread Deepayan Sarkar
On 9/21/06, John Tillinghast [EMAIL PROTECTED] 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?

I'm guessing that the source you are working on has been obtained by
unzipping the windows binary zip file. Despite appearances, that is
not the source code. For the proper source code, download the file
that's marked as source. In this case,

http://bioconductor.org/packages/1.8/bioc/html/LMGene.html

clearly labels the following as Source (and the corresponding zip
file as Windows Binary)

http://bioconductor.org/packages/1.8/bioc/src/contrib/LMGene_1.0.0.tar.gz

This likely answers your other question as well.

-Deepayan

__
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
and provide commented, minimal, self-contained, reproducible code.


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

2006-09-21 Thread Duncan Murdoch
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

__
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
and provide commented, minimal, self-contained, reproducible code.


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

2006-09-21 Thread Henrik Bengtsson
Hmm...  sounds like you're on Windows and have the Explorer setup such
that it is hiding file extensions.  You can try to use list.files()
from R to see if the files actually have file extension.

If this is your problem, open My Computer - Tools - Folder
Options... and select tab View.  Make sure that Hide extensions for
known file types is *NOT* selected.

/H



On 9/21/06, John Tillinghast [EMAIL PROTECTED] 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?

 [[alternative HTML version deleted]]

 __
 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
 and provide commented, minimal, self-contained, reproducible code.


__
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
and provide commented, minimal, self-contained, reproducible code.


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

2006-09-21 Thread John Tillinghast
Yes, this was exactly the problem: I was using the unzipped package, not the
source.
Now it works!

-- Forwarded message --
From: Deepayan Sarkar [EMAIL PROTECTED]
Date: Sep 21, 2006 2:58 PM
Subject: Re: [R] Adding .R to source file keeps R from reading it?
To: John Tillinghast [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch

On 9/21/06, John Tillinghast [EMAIL PROTECTED] 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?

I'm guessing that the source you are working on has been obtained by
unzipping the windows binary zip file. Despite appearances, that is
not the source code. For the proper source code, download the file
that's marked as source. In this case,

http://bioconductor.org/packages/1.8/bioc/html/LMGene.html

clearly labels the following as Source (and the corresponding zip
file as Windows Binary)

http://bioconductor.org/packages/1.8/bioc/src/contrib/LMGene_1.0.0.tar.gz

This likely answers your other question as well.

-Deepayan

[[alternative HTML version deleted]]

__
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
and provide commented, minimal, self-contained, reproducible code.