promptClass fails to identify methods associated with the class. Here
is a fix:
Index: promptClass.R
==================================================================---
promptClass.R (revision 41719)
+++ promptClass.R (working copy)
@@ -165,7 +165,7 @@
if (nmeths > 0) {
.meths.body <- " \\describe{"
for (i in 1:nmeths) {
- .sigmat <- sigsList(methnms[i], where)
+ .sigmat <- sigsList(methnms[i], where=whereClass)
for (j in seq_along(.sigmat)) {
if (!all(is.na(match(.sigmat[[j]],clName)))) {
methn.i <- escape(methnms[i])
Index: RMethodUtils.R
==================================================================---
RMethodUtils.R (revision 41719)
+++ RMethodUtils.R (working copy)
@@ -621,7 +621,7 @@
getMethodsMetaData <-
## get the methods meta-data for function f on database where
function(f, where = topenv(parent.frame())) {
- mname <- mlistMetaName(f, where)
+ mname <- mlistMetaName(f, getPackageName(where))
if(exists(mname, where = where, inherits = missing(where)))
get(mname, where)
else
Seth Falcon <sfalcon at fhcrc.org> writes:
> cstrato <cstrato at aon.at> writes:
>
>> Dear all,
>>
>> What is the best way to write the docs for S4 classes?
>>
>> Concretely, is it possible to include the methods in the class
>> documentation?
>> For example, the documentation for class "AffyBatch" contains
all methods.
>> However, when I do:
>> promptClass("AffyBatch")
>> the relevant output of file "AffyBatch-class.Rd" is:
>> \section{Methods}{
>> No methods defined with class "AffyBatch" in the
signature.
>> }
>
> promptClass used to provide more useful output. You might want to
> report the issue on one of the R lists.
>
>> Since PromptClass() contains a parameter "where" is it
possible to use
>> it, and how?
>
> I'm not sure that is relevant here.
>
> One thing that can be useful here is
showMethods(classes="AffyBatch").
> The problem with static documentation for methods is that what methods
> are available can change based on what packages are attached.
>
> If showMethods or a wrapper for it could be convinced to output a link
> to a help file, then it might actually be a good way to go...
>
> + seth
>
> --
> Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research
Center
> http://bioconductor.org
>
> _______________________________________________
> Bioc-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
--
Martin Morgan
Bioconductor / Computational Biology
http://bioconductor.org
Dear Martin Thank you for sending the fast fix to the problem. Best regards Christian Martin Morgan wrote:> promptClass fails to identify methods associated with the class. Here > is a fix: > > Index: promptClass.R > ==================================================================> --- promptClass.R (revision 41719) > +++ promptClass.R (working copy) > @@ -165,7 +165,7 @@ > if (nmeths > 0) { > .meths.body <- " \\describe{" > for (i in 1:nmeths) { > - .sigmat <- sigsList(methnms[i], where) > + .sigmat <- sigsList(methnms[i], where=whereClass) > for (j in seq_along(.sigmat)) { > if (!all(is.na(match(.sigmat[[j]],clName)))) { > methn.i <- escape(methnms[i]) > Index: RMethodUtils.R > ==================================================================> --- RMethodUtils.R (revision 41719) > +++ RMethodUtils.R (working copy) > @@ -621,7 +621,7 @@ > getMethodsMetaData <- > ## get the methods meta-data for function f on database where > function(f, where = topenv(parent.frame())) { > - mname <- mlistMetaName(f, where) > + mname <- mlistMetaName(f, getPackageName(where)) > if(exists(mname, where = where, inherits = missing(where))) > get(mname, where) > else > > Seth Falcon <sfalcon at fhcrc.org> writes: > > >> cstrato <cstrato at aon.at> writes: >> >> >>> Dear all, >>> >>> What is the best way to write the docs for S4 classes? >>> >>> Concretely, is it possible to include the methods in the class >>> documentation? >>> For example, the documentation for class "AffyBatch" contains all methods. >>> However, when I do: >>> promptClass("AffyBatch") >>> the relevant output of file "AffyBatch-class.Rd" is: >>> \section{Methods}{ >>> No methods defined with class "AffyBatch" in the signature. >>> } >>> >> promptClass used to provide more useful output. You might want to >> report the issue on one of the R lists. >> >> >>> Since PromptClass() contains a parameter "where" is it possible to use >>> it, and how? >>> >> I'm not sure that is relevant here. >> >> One thing that can be useful here is showMethods(classes="AffyBatch"). >> The problem with static documentation for methods is that what methods >> are available can change based on what packages are attached. >> >> If showMethods or a wrapper for it could be convinced to output a link >> to a help file, then it might actually be a good way to go... >> >> + seth >> >> -- >> Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center >> http://bioconductor.org >> >> _______________________________________________ >> Bioc-devel at stat.math.ethz.ch mailing list >> https://stat.ethz.ch/mailman/listinfo/bioc-devel >> > >
>>>>> "MartinMo" == Martin Morgan <mtmorgan at fhcrc.org> >>>>> on Sat, 26 May 2007 21:44:27 -0700 writes:MartinMo> promptClass fails to identify methods associated MartinMo> with the class. Here is a fix: Thank you, Martin; I've applied your patch to my working copy of R-devel, and I can confirm it solves the problem for class "AffyBatch" (from bioconductor package 'affy'). However it does not seem to fix the problem in my case: library(Matrix) promptClass("sparseMatrix") which still produces a sparseMatrix-class.Rd file which contains \section{Methods}{ No methods defined with class "sparseMatrix" in the signature. } so there's at least another bug there. One difference: "sparseMatrix" is a virtual class, "AffyBatch" not, but then showMethods(classes = "..") works for both. I'd be glad if you have time to find another patch ;-) :-) Martin Maechler >> cstrato <cstrato at aon.at> writes: >> >>> Dear all, >>> >>> What is the best way to write the docs for S4 classes? >>> >>> Concretely, is it possible to include the methods in the >>> class documentation? For example, the documentation for >>> class "AffyBatch" contains all methods. However, when I >>> do: promptClass("AffyBatch") the relevant output of file >>> "AffyBatch-class.Rd" is: \section{Methods}{ No methods >>> defined with class "AffyBatch" in the signature. } >> promptClass used to provide more useful output. You >> might want to report the issue on one of the R lists. >> >>> Since PromptClass() contains a parameter "where" is it >>> possible to use it, and how? >> I'm not sure that is relevant here. >> >> One thing that can be useful here is >> showMethods(classes="AffyBatch"). The problem with >> static documentation for methods is that what methods are >> available can change based on what packages are attached. >> >> If showMethods or a wrapper for it could be convinced to >> output a link to a help file, then it might actually be a >> good way to go... >> >> + seth >> >> -- >> Seth Falcon | Computational Biology | Fred Hutchinson >> Cancer Research Center http://bioconductor.org >> >> _______________________________________________ >> Bioc-devel at stat.math.ethz.ch mailing list >> https://stat.ethz.ch/mailman/listinfo/bioc-devel MartinMo> -- Martin Morgan Bioconductor / Computational MartinMo> Biology http://bioconductor.org MartinMo> ______________________________________________ MartinMo> R-devel at r-project.org mailing list MartinMo> https://stat.ethz.ch/mailman/listinfo/r-devel