R in Macro Language syntax

You can use the <code language_="r"> tag to add R code to your Macro Language queries.

The <code> tag in 1010data Macro Language now supports the attribute language_="r", allowing your analysis to contain R code. See <code> in the 1010data Reference Manual for more information.

On entering the R session from <code>, the R session automatically get the variables ops and table. ops represents the current state of query operations in effect up to the <code> tag. table will normally be default.lonely. On exiting <code>, the platform will examine the R session for a variable named ops and extract it. The new ops variable will now represent the current state of the query. This allows the user to modify the query by modifying ops or replace the query entirely with a completely new set of ops.

When using the <code language_="r"> tag, it is necessary to put the R functions and related operations inside of a CDATA tag.

Note: Your account must be specifically enabled to make use of the R language.

Syntax

The syntax for R language within 1010data Macro Language is as follows:

<code language_="r">
<![CDATA[r functions]]>
</code>