These are the most common (and least problematic) scenarios for where the R user normally encounters or needs metaprogramming:
Present to the user the same expressions that appear in the R code. For example, automatically generating plot labels.
Saving information about how a function was called, so as to re-call it later. For example, model objects that allow derived models and application of different data.
Forwarding your "raw" arguments to another function, which itself uses metaprogramming.
line.plot <- function(x, y, ...) { plot(x, y, ...) }
line.plot <- function(x, y, ...) { args <- get_call() args <- c(args(x=x, y=y), dots(...)) plot %()% args }
line.plot <- function(x, y, ...) { }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.