Closed sckott closed 11 years ago
aliases give another name to a function as a convenience to the user. For
example, qplot
in ggplot is aliased as quickplot
-- so you can call
quickplot
in your code anywhere you call qplot. (Perhaps because you
wanted the code to be more 'self-documenting' and found the name qplot
to
be mysterious...). See
https://github.com/hadley/ggplot2/blob/8faa879b3d55877d9b9ef018a610178fc490428e/R/quick-plot.r
for
the roxygen documentation of qplot.
I thought it might be helpful to some users to have nexml_write be aliases as write.nexml, mimicking the existing write.nexus naming convention. Perhaps I just need to put both the real function name and the alias in my alias list??
On Fri, Sep 6, 2013 at 12:43 PM, Scott Chamberlain <notifications@github.com
wrote:
@cboettig https://github.com/cboettig not sure how aliases work I guess. What is the point of aliases if the alias isn't available to use as such? I must not understand what they do
— Reply to this email directly or view it on GitHubhttps://github.com/ropensci/RNeXML/issues/3#issuecomment-23964461 .
Carl Boettiger UC Santa Cruz http://carlboettiger.info/
Okay, cool. Yeah, not sure how to make aliases work, but neither write.nexml
nor read.nexml
is there
Aha!
So the @aliases
tag doesn't do much - it just lets R know that two functions share the same documentation.
You still need to define the alias function as a copy of the existing function manually, e.g. add the line read.nexml <- nexml_read
. You also need to add both function names explicitly after the @export
@cboettig not sure how aliases work I guess. What is the point of aliases if the alias isn't available to use as such? I must not understand what they do