Description Usage Arguments Details See Also Examples

This function overloads the `~`

operator to turn statements like
`~{factor(x, levels = c("A", "B"))}`

into
`x <- factor(x, levels = c("A", "B")`

while leaving normal formula expressions alone.

1 | ```
"~"(x, y = NULL)
``` |

`x` |
anything. If |

`y` |
anything. Only used for compatibility with the formula operator. |

In general, if we called `~{someexpr(x, ...)}`

, turn that into
`x <- someexpr(x, ...)`

in the parent environment. Otherwise, treat it as a formula.

This is dangerous meta-programming, but we live on the edge!

1 2 3 4 5 |

robertzk/productivus documentation built on March 19, 2018, 12:21 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.