You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
?imgRaster should offer a choice between the SpatialExperiment and SpatialImage methods #111
I don't know how many other generics have methods for both classes, but methods for both classes should respond to ?<method-name>. Otherwise users have to type out ?"imgRaster,SpatialExperiment-method", which is not obvious.
Yeah, I found this not straightforward and really confusing to document actually... Could you clarify what you mean by "should respond to ?<method-name>"? I.e., what behavior would you expect / want to be supported? I think the issue is that most people (including me) will just do ?imgX, and it's not clear whether this should point to the SPI or SPE's imgData-methods doc. And yes, good point re imgSource; it's currently only documented under ?imgData-methods`...
Could you clarify what you mean by "should respond to ?"? I.e., what behavior would you expect / want to be supported?
Basically, if I do ?imgRaster, I should get a prompt like:
> ?cbind
Help on topic ‘cbind’ was found in the following packages:
Package Library
BiocGenerics /Users/luna/Software/R/R-4-2-branch/library
base /Users/luna/Software/R/devel/library
Choose one
1: Combine objects by rows or columns {BiocGenerics}
2: Combine R Objects by Rows or Columns {base}
Selection:
In this case, the two choices would be between the documentation pages for the SPExperiment and VSImage methods.
I believe this can be achieved by making an @aliases imgRaster on the documentation page for the SPE. Currently ?imgRaster goes directly to the VSI one.
I think this doesn't work. The above prompt upon ?<method> appears when multiple packages export <method>. However, when I add @alises imgRaster to the imgData-methods help page, ?imgRaster still goes directly to the SpatialImage-class one. Looks like having the same alias appear in multiple docs is ignored, and the first doc (whatever first means here) is shown silently.
Hm. In that case, it may be worth having an explicit page for the img* generic, so that anyone typing ?imgRaster will get to the documentation for the method rather than the class.
In general, it seems like we should document by generic, rather than by class, with the assumption that someone doing ?generic would prefer to know the generic rather than one of the classes it operates on.
The exception would be for generics that only apply to a single class, which can be grouped in the docpage for that class.
Activity
LTLA commentedon Aug 10, 2022
On a related note,
?imgSourcedoesn't appear to be actually documented.HelenaLC commentedon Aug 11, 2022
Yeah, I found this not straightforward and really confusing to document actually... Could you clarify what you mean by "should respond to
?<method-name>"? I.e., what behavior would you expect / want to be supported? I think the issue is that most people (including me) will just do?imgX, and it's not clear whether this should point to the SPI or SPE'simgData-methodsdoc. And yes, good point reimgSource; it's currently only documented under?imgData-methods`...LTLA commentedon Aug 11, 2022
Basically, if I do
?imgRaster, I should get a prompt like:In this case, the two choices would be between the documentation pages for the SPExperiment and VSImage methods.
I believe this can be achieved by making an
@aliases imgRasteron the documentation page for the SPE. Currently?imgRastergoes directly to the VSI one.HelenaLC commentedon Aug 12, 2022
I think this doesn't work. The above prompt upon
?<method>appears when multiple packages export<method>. However, when I add@alises imgRasterto theimgData-methodshelp page,?imgRasterstill goes directly to theSpatialImage-classone. Looks like having the same alias appear in multiple docs is ignored, and the first doc (whatever first means here) is shown silently.LTLA commentedon Aug 12, 2022
Hm. In that case, it may be worth having an explicit page for the
img*generic, so that anyone typing?imgRasterwill get to the documentation for the method rather than the class.In general, it seems like we should document by generic, rather than by class, with the assumption that someone doing
?genericwould prefer to know the generic rather than one of the classes it operates on.The exception would be for generics that only apply to a single class, which can be grouped in the docpage for that class.