[R] An small suggestion for the R team

Duncan Murdoch murdoch at stats.uwo.ca
Fri Aug 5 01:38:14 CEST 2005


Jose Claudio Faria wrote:
> Hi all,
> 
> I would like to suggest that all R functions/etc like:
>    codes-deprecated
>    grid-internal
>    ns-alt
>    ns-dblcolon
>    ns-hooks
>    ns-internals
>    ns-lowlev
>    ns-reflect.Rd
>    tools-internal
>    ts-defunct
>    utils-deprecated
>    utils-internal
>    ... and another
> 
> i.e, function/word separate for '-'
> 
> were all substituted by
>    codes_deprecated
>    grid_internal
>    ns_alt
>    ns_dblcolon
>    ns_hooks
>    ns_internals
>    ns_lowlev
>    ns_reflect.Rd
>    tools_internal
>    ts_defunct
>    utils_deprecated
>    utils_internal
>    ... and another
> 
> i.e, by '_'
> 
> Because it is impossible to make a good highlighter with the first one.

Your suggested names are all valid identifiers.  The "-" gives strings 
that are not.  That's intentional; the help system relies on it.  You 
find "utils-deprecated" using deprecated?utils.

If your highlighter has problems with the "-", then don't bother 
highlighting.  Those names aren't very common.  Or...
> 
> How to differentiating myValue:
> 
> varOne = 100
> varTwo = 50
> myValue = varOne-varTwo
> 
> from codes-deprecated, or ns-alt, for example.

...you could do it by context.  codes-deprecated will only show up in 
*.Rd files as a possible search term:  an alias, or a name.

Duncan Murdoch




More information about the R-help mailing list