[R] is that a bug

Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Wed Mar 18 11:16:58 CET 2009


Peter Dalgaard wrote:
> KunW wrote:
>   
>> Dear people, 
>>
>> I was using plot function, and kept getting information such as "Error in
>> axis(1, 1:4, LETTERS[1:4]) : too few arguments".
>> I use the examples given in 'axis' help, and got same error information.
>> Can any of you please tell me what's the problem and how can I fix it?
>> Thanks a lot and hope to hear from you soon,
>>
>>
>> Kun
>>     
>
> Did you accidentally redefine axis()? What does find("axis") say?
>
>   

hmm, this points me to the following issue:  that help pages looked up
for a symbol are not dependent on the current meaning of the symbol. 
i.e., if you redefine axis to whatever you want, ?axis will still open
the help page available from package:graphics.  (unless this has been
circumvented by loading another package, for example.)

one of the things i like in python -- and by no means only there -- is
that help pages (docstrings) can be defined in situ, within the
definition of a function, class, etc., and even changed dynamically on
the object.  typing help(foo) or ?foo provides information on the object
currently referred to by 'foo', not on some other object, incidentally
using the same name in some package on the search path.

back to the above, if redefining 'axis' caused ?axis to print a help
page (or complain about the lack of one) relevant for the new definition
of axis, instead of the package:graphics one, it might be easier for
users to note that the object they get from 'axis' is not the one
described in ?axis, and that that description is actually irrelevant.

but i think the idea would require a major change in the design of the r
help system, and that's of course unrealistic, so i'm just speculating.

vQ




More information about the R-help mailing list