EVOLUTION-MANAGER
Edit File: here.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Capture current evaluation context.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for here {plyr}"><tr><td>here {plyr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Capture current evaluation context.</h2> <h3>Description</h3> <p>This function captures the current context, making it easier to use <code>**ply</code> with functions that do special evaluation and need access to the environment where ddply was called from. </p> <h3>Usage</h3> <pre> here(f) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>f</code></td> <td> <p>a function that does non-standard evaluation</p> </td></tr> </table> <h3>Author(s)</h3> <p>Peter Meilstrup, <a href="https://github.com/crowding">https://github.com/crowding</a> </p> <h3>Examples</h3> <pre> df <- data.frame(a = rep(c("a","b"), each = 10), b = 1:20) f1 <- function(label) { ddply(df, "a", mutate, label = paste(label, b)) } ## Not run: f1("name:") # Doesn't work because mutate can't find label in the current scope f2 <- function(label) { ddply(df, "a", here(mutate), label = paste(label, b)) } f2("name:") # Works :) </pre> <hr /><div style="text-align: center;">[Package <em>plyr</em> version 1.8.7 <a href="00Index.html">Index</a>]</div> </body></html>