Template:R

From "A B C"
Revision as of 18:00, 16 January 2015 by Boris (talk | contribs)
Jump to navigation Jump to search

Template to link R commands and packages to their respective information sources.

If the first parameter does not end in (), it is assumed to be a package. Otherwise, it is assumed to be a function in base R.

If the second parameter is empty, the package link on rdocumentation.org is created. Otherwise the function link is created.

If a third parameter is present, that will be the linked text.

Test cases: {{#if:4|mean()|[1] {{#if:|knitr|[2] {{#if:|par()|[3] {{#if:|colorRamp()|[4]

{{#if:

  1. yes: it's a base function. construct link.

| [http://www.rdocumentation.org/packages/base/functions/{{{1}}}

  1. if second or third parameter is present, that will be the linked text.

{{{1}}} ]


  1. no: it's a package. construct link

| [http://www.rdocumentation.org/packages/{{{1}}}/functions/

  1. if a second parameter is present, that is the function we want

{{{1}}}-package

  1. if a third parameter is present, that is the linked text

{{{1}}} ]


{{#if:|{{{1}}}|[5]