<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>man/..Rd</filename>
    </added>
    <added>
      <filename>man/.matrix_to_df.Rd</filename>
    </added>
    <added>
      <filename>man/[.indexed.Rd</filename>
    </added>
    <added>
      <filename>man/[.split.Rd</filename>
    </added>
    <added>
      <filename>man/[[.indexed_array.Rd</filename>
    </added>
    <added>
      <filename>man/[[.indexed_df.Rd</filename>
    </added>
    <added>
      <filename>man/a_ply.Rd</filename>
    </added>
    <added>
      <filename>man/aaply.Rd</filename>
    </added>
    <added>
      <filename>man/adply.Rd</filename>
    </added>
    <added>
      <filename>man/alply.Rd</filename>
    </added>
    <added>
      <filename>man/amv_dim.Rd</filename>
    </added>
    <added>
      <filename>man/amv_dimnames.Rd</filename>
    </added>
    <added>
      <filename>man/arrange.Rd</filename>
    </added>
    <added>
      <filename>man/as.data.frame.function.Rd</filename>
    </added>
    <added>
      <filename>man/as.list.indexed.Rd</filename>
    </added>
    <added>
      <filename>man/as.list.split.Rd</filename>
    </added>
    <added>
      <filename>man/as.quoted.NULL.Rd</filename>
    </added>
    <added>
      <filename>man/as.quoted.Rd</filename>
    </added>
    <added>
      <filename>man/as.quoted.call.Rd</filename>
    </added>
    <added>
      <filename>man/as.quoted.character.Rd</filename>
    </added>
    <added>
      <filename>man/as.quoted.formula.Rd</filename>
    </added>
    <added>
      <filename>man/as.quoted.numeric.Rd</filename>
    </added>
    <added>
      <filename>man/as.quoted.quoted.Rd</filename>
    </added>
    <added>
      <filename>man/as_df.Rd</filename>
    </added>
    <added>
      <filename>man/c.quoted.Rd</filename>
    </added>
    <added>
      <filename>man/catcolwise.Rd</filename>
    </added>
    <added>
      <filename>man/colwise.Rd</filename>
    </added>
    <added>
      <filename>man/compact.Rd</filename>
    </added>
    <added>
      <filename>man/copy_rownames.Rd</filename>
    </added>
    <added>
      <filename>man/create_progress_bar.Rd</filename>
    </added>
    <added>
      <filename>man/d_ply.Rd</filename>
    </added>
    <added>
      <filename>man/daply.Rd</filename>
    </added>
    <added>
      <filename>man/ddply.Rd</filename>
    </added>
    <added>
      <filename>man/defaults.Rd</filename>
    </added>
    <added>
      <filename>man/dims.Rd</filename>
    </added>
    <added>
      <filename>man/dlply.Rd</filename>
    </added>
    <added>
      <filename>man/each.Rd</filename>
    </added>
    <added>
      <filename>man/end_iteration.Rd</filename>
    </added>
    <added>
      <filename>man/eval.quoted.Rd</filename>
    </added>
    <added>
      <filename>man/failwith.Rd</filename>
    </added>
    <added>
      <filename>man/icanhasnext.Rd</filename>
    </added>
    <added>
      <filename>man/indexed_array.Rd</filename>
    </added>
    <added>
      <filename>man/indexed_df.Rd</filename>
    </added>
    <added>
      <filename>man/is.discrete.Rd</filename>
    </added>
    <added>
      <filename>man/is.formula.Rd</filename>
    </added>
    <added>
      <filename>man/is.iterator.Rd</filename>
    </added>
    <added>
      <filename>man/iteration_has_ended.Rd</filename>
    </added>
    <added>
      <filename>man/join.Rd</filename>
    </added>
    <added>
      <filename>man/join.keys.Rd</filename>
    </added>
    <added>
      <filename>man/l_ply.Rd</filename>
    </added>
    <added>
      <filename>man/laply.Rd</filename>
    </added>
    <added>
      <filename>man/ldply.Rd</filename>
    </added>
    <added>
      <filename>man/length.indexed.Rd</filename>
    </added>
    <added>
      <filename>man/length.indexed_array.Rd</filename>
    </added>
    <added>
      <filename>man/liply.Rd</filename>
    </added>
    <added>
      <filename>man/list_to_array.Rd</filename>
    </added>
    <added>
      <filename>man/list_to_dataframe.Rd</filename>
    </added>
    <added>
      <filename>man/list_to_vector.Rd</filename>
    </added>
    <added>
      <filename>man/llply.Rd</filename>
    </added>
    <added>
      <filename>man/m_ply.Rd</filename>
    </added>
    <added>
      <filename>man/maply.Rd</filename>
    </added>
    <added>
      <filename>man/mdply.Rd</filename>
    </added>
    <added>
      <filename>man/mlply.Rd</filename>
    </added>
    <added>
      <filename>man/names.indexed.Rd</filename>
    </added>
    <added>
      <filename>man/names.indexed_array.Rd</filename>
    </added>
    <added>
      <filename>man/names.quoted.Rd</filename>
    </added>
    <added>
      <filename>man/new_iterator.Rd</filename>
    </added>
    <added>
      <filename>man/ninteraction.Rd</filename>
    </added>
    <added>
      <filename>man/numcolwise.Rd</filename>
    </added>
    <added>
      <filename>man/nunique.Rd</filename>
    </added>
    <added>
      <filename>man/print.indexed.Rd</filename>
    </added>
    <added>
      <filename>man/print.quoted.Rd</filename>
    </added>
    <added>
      <filename>man/print.split.Rd</filename>
    </added>
    <added>
      <filename>man/progress_none.Rd</filename>
    </added>
    <added>
      <filename>man/progress_text.Rd</filename>
    </added>
    <added>
      <filename>man/progress_tk.Rd</filename>
    </added>
    <added>
      <filename>man/progress_win.Rd</filename>
    </added>
    <added>
      <filename>man/quickdf.Rd</filename>
    </added>
    <added>
      <filename>man/r_ply.Rd</filename>
    </added>
    <added>
      <filename>man/raply.Rd</filename>
    </added>
    <added>
      <filename>man/rbind.fill.Rd</filename>
    </added>
    <added>
      <filename>man/rdply.Rd</filename>
    </added>
    <added>
      <filename>man/reduce_dim.Rd</filename>
    </added>
    <added>
      <filename>man/rlply.Rd</filename>
    </added>
    <added>
      <filename>man/splat.Rd</filename>
    </added>
    <added>
      <filename>man/split_labels.Rd</filename>
    </added>
    <added>
      <filename>man/splitter_a.Rd</filename>
    </added>
    <added>
      <filename>man/splitter_d.Rd</filename>
    </added>
    <added>
      <filename>man/summarise.Rd</filename>
    </added>
    <added>
      <filename>man/true.Rd</filename>
    </added>
    <added>
      <filename>man/tryNULL.Rd</filename>
    </added>
    <added>
      <filename>man/try_default.Rd</filename>
    </added>
    <added>
      <filename>man/tryapply.Rd</filename>
    </added>
    <added>
      <filename>man/unrowname.Rd</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,9 +4,24 @@ Title: Tools for splitting, applying and combining data
 Version: 0.1.10
 Author: Hadley Wickham &lt;h.wickham@gmail.com&gt;
 Maintainer: Hadley Wickham &lt;h.wickham@gmail.com&gt;
-Description: plyr is a set of tools that solves a common set of problems: you need to break a big problem down into manageable pieces, operate on each pieces and then put all the pieces back together.  For example, you might want to fit a model to each spatial location or time point in your study, summarise data by panels or collapse high-dimensional arrays to simpler summary statistics.
+Description: plyr is a set of tools that solves a common set of
+    problems: you need to break a big problem down into manageable
+    pieces, operate on each pieces and then put all the pieces back
+    together.  For example, you might want to fit a model to each
+    spatial location or time point in your study, summarise data by
+    panels or collapse high-dimensional arrays to simpler summary
+    statistics.
 URL: http://had.co.nz/plyr
 Depends: R (&gt;= 2.8)
-Suggests: abind, tcltk
-License: R
-LazyData: true
\ No newline at end of file
+Suggests: RUnit, abind, tcltk
+License: GPL
+LazyData: true
+Collate: 'dimensions.r' 'helper-arrange.r' 'helper-col-wise.r'
+    'helper-data-frame.r' 'helper-defaults.r' 'helper-each.r'
+    'helper-splat.r' 'helper-summarise.r' 'helper-try.r'
+    'indexed-array.r' 'indexed-data-frame.r' 'indexed.r' 'iterator.r'
+    'join.r' 'ninteraction.r' 'ply-array.r' 'ply-data-frame.r'
+    'ply-iterator.r' 'ply-list.r' 'ply-mapply.r' 'ply-null.r'
+    'ply-replicate.r' 'progress.r' 'quote.r' 'rbind.r'
+    'simplify-array.r' 'simplify-data-frame.r' 'simplify-vector.r'
+    'split-array.r' 'split-data-frame.r' 'split.r' 'utils.r'</diff>
      <filename>DESCRIPTION</filename>
    </modified>
    <modified>
      <diff>@@ -1,27 +1,27 @@
-# Number of dimensions
-# Number of dimensions of an array or vector
-# 
-# @arguments array 
-# @keyword internal
+#' Number of dimensions
+#' Number of dimensions of an array or vector
+#' 
+#' @param x array 
+#' @keywords internal
 dims &lt;- function(x) length(amv_dim(x))
 
-# Dimensions
-# Consistent dimensions for vectors, matrices and arrays.
-# 
-# @arguments array, matrix or vector
-# @keyword internal 
+#' Dimensions
+#' Consistent dimensions for vectors, matrices and arrays.
+#' 
+#' @param x array, matrix or vector
+#' @keywords internal 
 amv_dim &lt;- function(x) if (is.vector(x)) length(x) else dim(x)
 
 
-# Dimension names
-# Consistent dimnames for vectors, matrices and arrays.
-# 
-# Unlike \code{\link{dimnames}} no part of the output will ever be
-# null.  If a component of dimnames is omitted, \code{amv_dimnames}
-# will return an integer sequence of the appropriate length.
-# 
-# @arguments array, matrix or vector
-# @keyword internal 
+#' Dimension names
+#' Consistent dimnames for vectors, matrices and arrays.
+#' 
+#' Unlike \code{\link{dimnames}} no part of the output will ever be
+#' null.  If a component of dimnames is omitted, \code{amv_dimnames}
+#' will return an integer sequence of the appropriate length.
+#' 
+#' @param x array, matrix or vector
+#' @keywords internal 
 amv_dimnames &lt;- function(x) {
   d &lt;- if (is.vector(x)) list(names(x)) else dimnames(x)
   
@@ -33,11 +33,11 @@ amv_dimnames &lt;- function(x) {
   d
 }
 
-# Reduce dimensions
-# Remove extraneous dimensions
-# 
-# @arguments array
-# @keyword internal 
+#' Reduce dimensions
+#' Remove extraneous dimensions
+#' 
+#' @arguments array
+#' @keyword internal 
 reduce_dim &lt;- function(x) {
   do.call(&quot;[&quot;, c(list(x), lapply(dim(x), function(x) if (x==1) 1 else T), drop=TRUE))  
 }</diff>
      <filename>R/dimensions.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,43 +1,44 @@
-# Column-wise function
-# Turn a function that operates on a vector into a function that operates column-wise on a data.frame
-#
-# \code{catcolwise} and \code{numcolwise} provide version that only operate
-# on discrete and numeric variables respectively
-# 
-# @arguments function
-# @arguments either function that tests columns for inclusion, or a quoted object giving which columns to process
-# @alias catcolwise
-# @alias numcolwise
-#X # Count number of missing values
-#X nmissing &lt;- function(x) sum(is.na(x))
-#X
-#X # Apply to every column in a data frame 
-#X colwise(nmissing)(baseball)
-#X # This syntax looks a little different.  It is shorthand for the 
-#X # the following:
-#X f &lt;- colwise(nmissing)
-#X f(baseball)
-#X
-#X # This is particularly useful in conjunction with d*ply
-#X ddply(baseball, .(year), colwise(nmissing))
-#X 
-#X # To operate only on specified columns, supply them as the second
-#X # argument.  Many different forms are accepted.
-#X ddply(baseball, .(year), colwise(nmissing, .(sb, cs, so)))
-#X ddply(baseball, .(year), colwise(nmissing, c(&quot;sb&quot;, &quot;cs&quot;, &quot;so&quot;)))
-#X ddply(baseball, .(year), colwise(nmissing, ~ sb + cs + so))
-#X
-#X # Alternatively, you can specify a boolean function that determines
-#X # whether or not a column should be included
-#X ddply(baseball, .(year), colwise(nmissing, is.character))
-#X ddply(baseball, .(year), colwise(nmissing, is.numeric))
-#X ddply(baseball, .(year), colwise(nmissing, is.discrete))
-#X
-#X # These last two cases are particularly common, so some shortcuts are 
-#X # provided:
-#X ddply(baseball, .(year), numcolwise(nmissing))
-#X ddply(baseball, .(year), catcolwise(nmissing))
-colwise &lt;- function(.fun, .cols = function(x) TRUE) {
+#' Column-wise function.
+#' Turn a function that operates on a vector into a function that operates
+#' column-wise on a data.frame.
+#'
+#' \code{catcolwise} and \code{numcolwise} provide version that only operate
+#' on discrete and numeric variables respectively.
+#' 
+#' @param .fun function
+#' @param .cols either function that tests columns for inclusion, or a quoted object giving which columns to process
+#' @aliases colwise catcolwise numcolwise
+#' @examples
+#' # Count number of missing values
+#' nmissing &lt;- function(x) sum(is.na(x))
+#'
+#' # Apply to every column in a data frame 
+#' colwise(nmissing)(baseball)
+#' # This syntax looks a little different.  It is shorthand for the 
+#' # the following:
+#' f &lt;- colwise(nmissing)
+#' f(baseball)
+#'
+#' # This is particularly useful in conjunction with d*ply
+#' ddply(baseball, .(year), colwise(nmissing))
+#' 
+#' # To operate only on specified columns, supply them as the second
+#' # argument.  Many different forms are accepted.
+#' ddply(baseball, .(year), colwise(nmissing, .(sb, cs, so)))
+#' ddply(baseball, .(year), colwise(nmissing, c(&quot;sb&quot;, &quot;cs&quot;, &quot;so&quot;)))
+#' ddply(baseball, .(year), colwise(nmissing, ~ sb + cs + so))
+#'
+#' # Alternatively, you can specify a boolean function that determines
+#' # whether or not a column should be included
+#' ddply(baseball, .(year), colwise(nmissing, is.character))
+#' ddply(baseball, .(year), colwise(nmissing, is.numeric))
+#' ddply(baseball, .(year), colwise(nmissing, is.discrete))
+#'
+#' # These last two cases are particularly common, so some shortcuts are 
+#' # provided:
+#' ddply(baseball, .(year), numcolwise(nmissing))
+#' ddply(baseball, .(year), catcolwise(nmissing))
+colwise &lt;- function(.fun, .cols = true) {
   if (!is.function(.cols)) {
     .cols &lt;- as.quoted(.cols)
     filter &lt;- function(df) as.data.frame(eval.quoted(.cols, df))
@@ -63,3 +64,5 @@ numcolwise &lt;- function(.fun, .try = FALSE) {
   colwise(.fun, is.numeric)
 }
 
+
+true &lt;- function(x) TRUE
\ No newline at end of file</diff>
      <filename>R/helper-col-wise.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,14 @@
-# Make a function return a data frame
-# Create a new function that returns the existing function wrapped in a data.frame
-# 
-# This is useful when calling \code{*dply} functions with a function that
-# returns a vector, and you want the output in rows, rather than columns
-# 
-# @keyword manip
-# @argument function to make return a data frame
-# @argument other arguments necessary to match the generic, but not used
+#' Make a function return a data frame
+#' Create a new function that returns the existing function wrapped in a data.frame
+#' 
+#' This is useful when calling \code{*dply} functions with a function that
+#' returns a vector, and you want the output in rows, rather than columns
+#' 
+#' @keywords manip
+#' @param x function to make return a data frame
+#' @param row.names necessary to match the generic, but not used
+#' @param optional necessary to match the generic, but not used
+#' @param ... necessary to match the generic, but not used
 as.data.frame.function &lt;- function(x, row.names, optional, ...) {
   name &lt;- deparse(substitute(x))
   function(...) data.frame(value = x(...))</diff>
      <filename>R/helper-data-frame.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,9 @@
-
-# Set defaults
-# Convient method for combining a list of values with their defaults.
-# 
-# @arguments list of values
-# @arguments defaults
-# @keyword manip 
+#' Set defaults
+#' Convient method for combining a list of values with their defaults.
+#' 
+#' @param x list of values
+#' @param y defaults
+#' @keywords manip 
 defaults &lt;- function(x, y)  {
   c(x, y[setdiff(names(y), names(x))])
 } </diff>
      <filename>R/helper-defaults.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,16 @@
-# Aggregate multiple functions into a single function
-# Combine multiple functions to a single function returning a named vector of outputs
-# 
-# Each function should produce a single number as output
-# 
-# @arguments functions to combine
-# @keyword manip
-#X each(min, max)(1:10)
-#X each(&quot;min&quot;, &quot;max&quot;)(1:10)
-#X each(c(&quot;min&quot;, &quot;max&quot;))(1:10)
-#X each(c(min, max))(1:10)
-#X each(length, mean, var)(rnorm(100))
+#' Aggregate multiple functions into a single function
+#' Combine multiple functions to a single function returning a named vector of outputs
+#' 
+#' Each function should produce a single number as output
+#' 
+#' @param ... functions to combine
+#' @keywords manip
+#' @examples
+#' each(min, max)(1:10)
+#' each(&quot;min&quot;, &quot;max&quot;)(1:10)
+#' each(c(&quot;min&quot;, &quot;max&quot;))(1:10)
+#' each(c(min, max))(1:10)
+#' each(length, mean, var)(rnorm(100))
 each &lt;- function(...) {
   fnames &lt;- laply(match.call()[-1], deparse)
   fs &lt;- list(...)</diff>
      <filename>R/helper-each.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,18 @@
-# `Splat' arguments to a function
-# Wraps a function in do.call 
-# 
-# This is useful when you want to pass a function a row of data frame or
-# array, and don't want to manually pull it apart in your function.
-# 
-# @arguments function to splat
-# @value a function
-# 
-#X hp_per_cyl &lt;- function(hp, cyl, ...) hp / cyl
-#X splat(hp_per_cyl)(mtcars[1,])
-#X splat(hp_per_cyl)(mtcars)
-#X
-#X f &lt;- function(mpg, wt, ...) data.frame(mw = mpg / wt)
-#X ddply(mtcars, .(cyl), splat(f))
+#' `Splat' arguments to a function
+#' Wraps a function in do.call 
+#' 
+#' This is useful when you want to pass a function a row of data frame or
+#' array, and don't want to manually pull it apart in your function.
+#' 
+#' @param flat function to splat
+#' @return a function
+#' @examples
+#' hp_per_cyl &lt;- function(hp, cyl, ...) hp / cyl
+#' splat(hp_per_cyl)(mtcars[1,])
+#' splat(hp_per_cyl)(mtcars)
+#'
+#' f &lt;- function(mpg, wt, ...) data.frame(mw = mpg / wt)
+#' ddply(mtcars, .(cyl), splat(f))
 splat &lt;- function(flat) {
   function(args, ...) {
     do.call(flat, c(args, list(...)))</diff>
      <filename>R/helper-splat.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,32 +1,29 @@
-# Summarise a data frame.
-# Create a new data frame that summarises an existing data frame.
-# 
-# Summarise works in an analagous way to transform, except instead of adding
-# columns to an existing data frame, it creates a new one.  This is
-# particularly useful in conjunction with \code{\link{ddply}} as it makes it
-# easy to perform group-wise summaries.
-# 
-# @arguments The data frame to be summarised
-# @arguments Further arguments of the form var = value
-# @keyword manip
-# @alias summarize
-#X summarise(baseball, 
-#X  duration = max(year) - min(year), 
-#X  nteams = length(unique(team)))
-#X ddply(baseball, &quot;id&quot;, summarise, 
-#X  duration = max(year) - min(year), 
-#X  nteams = length(unique(team)))
+#' Summarise a data frame.
+#' Create a new data frame that summarises an existing data frame.
+#' 
+#' Summarise works in an analagous way to transform, except instead of adding
+#' columns to an existing data frame, it creates a new one.  This is
+#' particularly useful in conjunction with \code{\link{ddply}} as it makes it
+#' easy to perform group-wise summaries.
+#' 
+#' @param .data the data frame to be summarised
+#' @param ... further arguments of the form var = value
+#' @keywords manip
+#' @aliases summarise summarize
+#' @examples
+#' summarise(baseball, 
+#'  duration = max(year) - min(year), 
+#'  nteams = length(unique(team)))
+#' ddply(baseball, &quot;id&quot;, summarise, 
+#'  duration = max(year) - min(year), 
+#'  nteams = length(unique(team)))
 summarise &lt;- function(.data, ...) {
   as.data.frame(eval(substitute(list(...)), .data, parent.frame()))
 }
 summarize &lt;- summarise
-# Alternative names: tally? sketch? abstract? abbreviate?
-
-
-# system.time(ddply(baseball, &quot;id&quot;, summarise, duration = max(year) - min(year), nteams = length(unique(team))))
 
 quickdf &lt;- function(list) {
   structure(list, 
     class = &quot;data.frame&quot;,
     row.names = seq_along(list[[1]]))
-}
\ No newline at end of file
+}</diff>
      <filename>R/helper-summarise.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,37 +1,39 @@
-# Fail with
-# Modify a function so that it returns a default value when there is an error.
-# 
-# @arguments default value
-# @arguments function
-# @argument should all error messages be suppressed?
-# @value a function
-# @seealso \code{\link{try_default}}
-# @keyword debugging
-#X f &lt;- function(x) if (x == 1) stop(&quot;Error!&quot;) else 1
-#X \dontrun{
-#X f(1)
-#X f(2)
-#X }
-#X
-#X safef &lt;- failwith(NULL, f)
-#X safef(1)
-#X safef(2) 
+#' Fail with
+#' Modify a function so that it returns a default value when there is an error.
+#' 
+#' @param default default value
+#' @param f function
+#' @param quiet all error messages be suppressed?
+#' @return a function
+#' @seealso \code{\link{try_default}}
+#' @keywords debugging
+#' @examples
+#' f &lt;- function(x) if (x == 1) stop(&quot;Error!&quot;) else 1
+#' \dontrun{
+#' f(1)
+#' f(2)
+#' }
+#'
+#' safef &lt;- failwith(NULL, f)
+#' safef(1)
+#' safef(2) 
 failwith &lt;- function(default = NULL, f, quiet = FALSE) {
   f &lt;- match.fun(f)
   function(...) try_default(f(...), default, quiet = quiet)
 }
 
-# Try, with default in case of error
-# \code{try_default} wraps try so that it returns a default value in the case of error.
-# 
-# \code{tryNULL} provides a useful special case when dealing with lists.
-# 
-# @alias tryNULL
-# @arguments expression to try
-# @arguments default value in case of error
-# @keyword internal
-# @seealso \code{\link{tryapply}}
-try_default &lt;- function(expr, default = NA, quiet = FALSE) {
+#' Try, with default in case of error.
+#' \code{try_default} wraps try so that it returns a default value in the case of error.
+#' 
+#' \code{tryNULL} provides a useful special case when dealing with lists.
+#' 
+#' @param expr expression to try
+#' @param default default value in case of error
+#' @param quiet should errors be printed (TRUE) or ignored (FALSE, default)
+#' @aliases try_default tryNULL
+#' @keywords internal
+#' @seealso \code{\link{tryapply}}
+try_default &lt;- function(expr, default, quiet = FALSE) {
   result &lt;- default
   if (quiet) {
     tryCatch(result &lt;- expr, error = function(e) {})    
@@ -43,10 +45,10 @@ try_default &lt;- function(expr, default = NA, quiet = FALSE) {
 tryNULL &lt;- function(expr) try_default(expr, NULL, quiet = TRUE)
 
 
-# Apply with built in try
-# Uses compact, lapply and tryNULL
-# 
-# @keyword internal
+#' Apply with built in try
+#' Uses compact, lapply and tryNULL
+#' 
+#' @keywords internal
 tryapply &lt;- function(list, fun, ...) {
   compact(lapply(list, function(x) tryNULL(fun(x, ...))))
 }
\ No newline at end of file</diff>
      <filename>R/helper-try.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,11 @@
-# An indexed array
-# Create a indexed array, a space efficient way of indexing into a large array
-# 
-# @arguments environment containing data frame
-# @argument list of indices
-# @keyword internal
-# @alias [[.indexed_array
-# @alias names.indexed_array
-# @alias length.indexed_array
+#' An indexed array
+#' Create a indexed array, a space efficient way of indexing into a large array
+#' 
+#' @param env environment containing data frame
+#' @param index list of indices
+#' @keywords internal
+#' @aliases indexex_array [[.indexed_array names.indexed_array
+#'   length.indexed_array
 indexed_array &lt;- function(env, index) {
   exact &lt;- all(laply(index, is.numeric))
 </diff>
      <filename>R/indexed-array.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,11 @@
-# An indexed list
-# Create a indexed list, a space efficient way of indexing into a large data frame
-# 
-# @arguments environment containing data frame
-# @argument list of indices
-# @keyword internal
-# @alias length.indexed
-# @alias names.indexed
-# @alias as.list.indexed
-# @alias [[.indexed_df
-# @alias [.indexed 
-# @alias print.indexed
+#' An indexed list
+#' Create a indexed list, a space efficient way of indexing into a large data frame
+#' 
+#' @param env environment containing data frame
+#' @param index list of indices
+#' @keywords internal
+#' @aliases indexed_df length.indexed names.indexed as.list.indexed
+#'   [[.indexed_df [.indexed print.indexed
 indexed_df &lt;- function(env, index) {
   structure(
     list(env = env, index = index),</diff>
      <filename>R/indexed-data-frame.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
-library(iterators)
 icanhasnext &lt;- function(iterator) {
   # If already has hasNext function return iterator unchanged
   if (!is.null(iterator$hasNext)) return(iterator)</diff>
      <filename>R/iterator.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,37 +1,12 @@
-# bsmall &lt;- subset(baseball, id %in% sample(unique(baseball$id), 10))[, 1:5]
-# bsmall$id &lt;- factor(bsmall$id)
-# bsmall &lt;- bsmall[with(bsmall, order(id, year, stint)), ]
-# bsmall &lt;- bsmall[sample(rownames(bsmall)),  ]
-# rownames(bsmall) &lt;- NULL
-
-# first &lt;- ddply(baseball, &quot;id&quot;, summarise, first = min(year))
-# system.time(b2 &lt;- merge(baseball, first, by = &quot;id&quot;, all.x = T))
-# system.time(b3 &lt;- join(baseball, first, by = &quot;id&quot;))
-# 
-# b2 &lt;- arrange(b2, id, year, stint)
-# b3 &lt;- arrange(b3, id, year, stint)
-# rownames(b2) &lt;- NULL
-# rownames(b3) &lt;- NULL
-# all.equal(b2, b3)
-
-# 
-# geo1 &lt;- merge(sales, ad, by = c(&quot;street&quot;, &quot;city&quot;, &quot;zip&quot;), all.x = TRUE)
-# geo1 &lt;- arrange(geo1, zip, city, street, date)
-# rownames(geo1) &lt;- NULL
-# 
-# geo2 &lt;- join(sales, ad, by = c(&quot;street&quot;, &quot;city&quot;, &quot;zip&quot;))
-# geo2 &lt;- arrange(geo2, zip, city, street, date)
-# rownames(geo2) &lt;- NULL
-# 
-# system.time(join(sales, ad, by = c(&quot;street&quot;, &quot;city&quot;, &quot;zip&quot;)))
-# 
-# all.equal(geo1, geo2)
-
-
-# Join
-#
-# Unlike merge, preserves the order of x no matter what join type is used.
-# If needed, rows from y will be added to the bottom.
+#' Join
+#'
+#' Unlike merge, preserves the order of x no matter what join type is used.
+#' If needed, rows from y will be added to the bottom.
+#'
+#' @examples
+#' first &lt;- ddply(baseball, &quot;id&quot;, summarise, first = min(year))
+#' system.time(b2 &lt;- merge(baseball, first, by = &quot;id&quot;, all.x = T))
+#' system.time(b3 &lt;- join(baseball, first, by = &quot;id&quot;))
 join &lt;- function(x, y, by = intersect(names(x), names(y)), type = &quot;left&quot;) {
   type &lt;- match.arg(type, c(&quot;left&quot;, &quot;right&quot;, &quot;inner&quot;, &quot;full&quot;))
   
@@ -68,11 +43,6 @@ join &lt;- function(x, y, by = intersect(names(x), names(y)), type = &quot;left&quot;) {
   }
 }
 
-copy_rownames &lt;- function(to, from) {
-  rownames(to) &lt;- rownames(from)
-  to
-}
-
 join.keys &lt;- function(x, y, by) {
   joint &lt;- rbind.fill(x[by], y[by])
   </diff>
      <filename>R/join.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,9 @@
-# Numerical interaction
-# A purely numerical interaction function that powers \code{aaply}.
-# 
-# @keyword internal
+#' Numerical interaction
+#' A purely numerical interaction function that powers \code{aaply}.
+#' 
+#' @param .variables list of variables
+#' @param drop drop unusued factor levels?
+#' @keywords internal
 ninteraction &lt;- function(.variables, drop = FALSE) {  
   if (length(.variables) == 0) {
     res &lt;- structure(rep.int(1L, nrow(.variables)), n = 1L)
@@ -48,11 +50,11 @@ ninteraction &lt;- function(.variables, drop = FALSE) {
   res
 }
 
-# Number of unique values
-# Calculate number of unique values of a variable as efficiently as possible.
-# 
-# @arguments vector
-# @keyword internal
+#' Number of unique values
+#' Calculate number of unique values of a variable as efficiently as possible.
+#' 
+#' @param x vector
+#' @keywords internal
 nunique &lt;- function(x) {
   if (is.factor(x)) {
     length(levels(x))</diff>
      <filename>R/ninteraction.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,33 +1,34 @@
-# Split list, apply function, and return results in an array
-# For each element of a list, apply function then combine results into an array
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits lists by
-# elements and combines the result into an array.  If there are no results,
-# then this function will return a vector of length 0 (\code{vector()}).
-# 
-# \code{laply} is very similar in spirit to \code{\link{sapply}} except that
-# it will always return an array, and the output is transposed with respect
-# \code{sapply} - each element of the list corresponds to a column, not a 
-# row.
-# 
-# 
-# @keyword manip
-# @arguments input list
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @arguments should extra dimensions of length 1 be dropped, simplifying the output.  Defaults to \code{TRUE}
-# @value if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
-#X laply(baseball, is.factor)
-#X # cf
-#X ldply(baseball, is.factor)
-#X colwise(is.factor)(baseball)
-#X
-#X laply(seq_len(10), identity)
-#X laply(seq_len(10), rep, times = 4)
-#X laply(seq_len(10), matrix, nrow = 2, ncol = 2)
+#' Split list, apply function, and return results in an array
+#' For each element of a list, apply function then combine results into an array
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits lists by
+#' elements and combines the result into an array.  If there are no results,
+#' then this function will return a vector of length 0 (\code{vector()}).
+#' 
+#' \code{laply} is very similar in spirit to \code{\link{sapply}} except that
+#' it will always return an array, and the output is transposed with respect
+#' \code{sapply} - each element of the list corresponds to a column, not a 
+#' row.
+#' 
+#' 
+#' @keywords manip
+#' @param .data input list
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @param .drop should extra dimensions of length 1 be dropped, simplifying the output.  Defaults to \code{TRUE}
+#' @return if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
+#' @examples
+#' laply(baseball, is.factor)
+#' # cf
+#' ldply(baseball, is.factor)
+#' colwise(is.factor)(baseball)
+#'
+#' laply(seq_len(10), identity)
+#' laply(seq_len(10), rep, times = 4)
+#' laply(seq_len(10), matrix, nrow = 2, ncol = 2)
 laply &lt;-  function(.data, .fun = NULL, ..., .progress = &quot;none&quot;, .drop = TRUE) {
   if (is.character(.fun)) .fun &lt;- do.call(&quot;each&quot;, as.list(.fun))
   if (!is.function(.fun)) stop(&quot;.fun is not a function.&quot;)
@@ -39,34 +40,34 @@ laply &lt;-  function(.data, .fun = NULL, ..., .progress = &quot;none&quot;, .drop = TRUE) {
 }
 
 
-# Split data frame, apply function, and return results in an array
-# For each subset of data frame, apply function then combine results into an array
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits data frames
-# by variable and combines the result into an array.  If there are no results,
-# then this function will return a vector of length 0 (\code{vector()}).
-# 
-# \code{daply} with a function that operates column-wise is similar to
-# \code{\link{aggregate}}. 
-# 
-# @keyword manip
-# @arguments data frame to be processed
-# @arguments variables to split data frame by, as quoted variables, a formula or character vector
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @arguments should extra dimensions of length 1 be dropped, simplifying the output.  Defaults to \code{TRUE}
-# @value if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
-#X daply(baseball, .(year), nrow)
-#X
-#X # Several different ways of summarising by variables that should not be 
-#X # included in the summary
-#X 
-#X daply(baseball[, c(2, 6:9)], .(year), mean)
-#X daply(baseball[, 6:9], .(baseball$year), mean)
-#X daply(baseball, .(year), function(df) mean(df[, 6:9]))
+#' Split data frame, apply function, and return results in an array
+#' For each subset of data frame, apply function then combine results into an array
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits data frames
+#' by variable and combines the result into an array.  If there are no results,
+#' then this function will return a vector of length 0 (\code{vector()}).
+#' 
+#' \code{daply} with a function that operates column-wise is similar to
+#' \code{\link{aggregate}}. 
+#' 
+#' @keywords manip
+#' @param .data data frame to be processed
+#' @param .variables variables to split data frame by, as quoted variables, a formula or character vector
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @param .drop should extra dimensions of length 1 be dropped, simplifying the output.  Defaults to \code{TRUE}
+#' @return if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
+#' daply(baseball, .(year), nrow)
+#'
+#' # Several different ways of summarising by variables that should not be 
+#' # included in the summary
+#' 
+#' daply(baseball[, c(2, 6:9)], .(year), mean)
+#' daply(baseball[, 6:9], .(baseball$year), mean)
+#' daply(baseball, .(year), function(df) mean(df[, 6:9]))
 daply &lt;- function(.data, .variables, .fun = NULL, ..., .progress = &quot;none&quot;, .drop = TRUE) {
   .data &lt;- as.data.frame(.data)
   .variables &lt;- as.quoted(.variables)
@@ -75,47 +76,47 @@ daply &lt;- function(.data, .variables, .fun = NULL, ..., .progress = &quot;none&quot;, .drop
   laply(.data = pieces, .fun = .fun, ..., .progress = .progress, .drop = .drop)
 }
 
-# Split array, apply function, and return results in an array
-# For each slice of an array, apply function then combine results into an array
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits matrices,
-# arrays and data frames by dimensions and combines the result into an array.
-# If there are no results, then this function will return a vector of length 0 (\code{vector()}).
-# 
-# This function is very similar to \code{\link{apply}}, except that it will
-# always return an array, and when the function returns &gt;1 d data structures,
-# those dimensions are added on to the highest dimensions, rather than the
-# lowest dimensions.  This makes \code{aaply} idempotent, so that
-# \code{apply(input, X, identity)} is equivalent to \code{aperm(input, X)}.
-# 
-# 
-# @keyword manip
-# @arguments matrix, array or data frame to be processed
-# @arguments a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @arguments should extra dimensions of length 1 be dropped, simplifying the output.  Defaults to \code{TRUE}
-# @value if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
-#X dim(ozone)
-#X aaply(ozone, 1, mean)
-#X aaply(ozone, 1, mean, .drop = FALSE)
-#X aaply(ozone, 3, mean)
-#X aaply(ozone, c(1,2), mean)
-#X
-#X dim(aaply(ozone, c(1,2), mean))
-#X dim(aaply(ozone, c(1,2), mean, .drop = FALSE)) 
-#X
-#X aaply(ozone, 1, each(min, max))
-#X aaply(ozone, 3, each(min, max))
-#X 
-#X standardise &lt;- function(x) (x - min(x)) / (max(x) - min(x))
-#X aaply(ozone, 3, standardise)
-#X aaply(ozone, 1:2, standardise)
-#X  
-#X aaply(ozone, 1:2, diff)
+#' Split array, apply function, and return results in an array
+#' For each slice of an array, apply function then combine results into an array
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits matrices,
+#' arrays and data frames by dimensions and combines the result into an array.
+#' If there are no results, then this function will return a vector of length 0 (\code{vector()}).
+#' 
+#' This function is very similar to \code{\link{apply}}, except that it will
+#' always return an array, and when the function returns &gt;1 d data structures,
+#' those dimensions are added on to the highest dimensions, rather than the
+#' lowest dimensions.  This makes \code{aaply} idempotent, so that
+#' \code{apply(input, X, identity)} is equivalent to \code{aperm(input, X)}.
+#' 
+#' 
+#' @keywords manip
+#' @param .data matrix, array or data frame to be processed
+#' @param .margins a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @param .drop should extra dimensions of length 1 be dropped, simplifying the output.  Defaults to \code{TRUE}
+#' @return if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
+#' dim(ozone)
+#' aaply(ozone, 1, mean)
+#' aaply(ozone, 1, mean, .drop = FALSE)
+#' aaply(ozone, 3, mean)
+#' aaply(ozone, c(1,2), mean)
+#'
+#' dim(aaply(ozone, c(1,2), mean))
+#' dim(aaply(ozone, c(1,2), mean, .drop = FALSE)) 
+#'
+#' aaply(ozone, 1, each(min, max))
+#' aaply(ozone, 3, each(min, max))
+#' 
+#' standardise &lt;- function(x) (x - min(x)) / (max(x) - min(x))
+#' aaply(ozone, 3, standardise)
+#' aaply(ozone, 1:2, standardise)
+#'  
+#' aaply(ozone, 1:2, diff)
 aaply &lt;- function(.data, .margins, .fun = NULL, ..., .progress = &quot;none&quot;, .drop = TRUE) {
   pieces &lt;- splitter_a(.data, .margins)
   </diff>
      <filename>R/ply-array.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,26 +1,26 @@
-# Split list, apply function, and return results in a data frame
-# For each element of a list, apply function then combine results into a data  frame
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits lists by
-# elements and combines the result into a data frame.  If there are no
-# results, then this function will return a data frame with zero rows and
-# columns (\code{data.frame()}).
-# 
-# The most unambiguous behaviour is achieved when \code{.fun} returns a 
-# data frame - in that case pieces will be combined with
-# \code{\link{rbind.fill}}.  If \code{.fun} returns an atomic vector of fixed
-# length, it will be \code{rbind}ed together and converted to a data frame.
-# Any other values will result in an error.
-# 
-# 
-# @keyword manip
-# @arguments list to be processed
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value a data frame
+#' Split list, apply function, and return results in a data frame
+#' For each element of a list, apply function then combine results into a data  frame
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits lists by
+#' elements and combines the result into a data frame.  If there are no
+#' results, then this function will return a data frame with zero rows and
+#' columns (\code{data.frame()}).
+#' 
+#' The most unambiguous behaviour is achieved when \code{.fun} returns a 
+#' data frame - in that case pieces will be combined with
+#' \code{\link{rbind.fill}}.  If \code{.fun} returns an atomic vector of fixed
+#' length, it will be \code{rbind}ed together and converted to a data frame.
+#' Any other values will result in an error.
+#' 
+#' 
+#' @keywords manip
+#' @param .data list to be processed
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return a data frame
 ldply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;) {
   if (!inherits(.data, &quot;split&quot;)) .data &lt;- as.list(.data)
   res &lt;- llply(.data = .data, .fun = .fun, ..., .progress = .progress)
@@ -28,40 +28,41 @@ ldply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;) {
   list_to_dataframe(res, attr(.data, &quot;split_labels&quot;))
 }
 
-# Split data frame, apply function, and return results in a data frame
-# For each subset of a data frame, apply function then combine results into a  data frame
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits data frames
-# by variables and combines the result into a data frame.  If there are no 
-# results, then this function will return a data frame with zero rows and
-# columns (\code{data.frame()}).
-# 
-# The most unambiguous behaviour is achieved when \code{.fun} returns a 
-# data frame - in that case pieces will be combined with
-# \code{\link{rbind.fill}}.  If \code{.fun} returns an atomic vector of fixed
-# length, it will be \code{rbind}ed together and converted to a data frame.
-# Any other values will result in an error.
-# 
-# 
-# @keyword manip
-# @arguments data frame to be processed
-# @arguments variables to split data frame by, as quoted variables, a formula or character vector
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value a data frame
-#X ddply(baseball, .(year), &quot;nrow&quot;) 
-#X ddply(baseball, .(lg), c(&quot;nrow&quot;, &quot;ncol&quot;)) 
-#X 
-#X rbi &lt;- ddply(baseball, .(year), summarise, 
-#X   mean_rbi = mean(rbi, na.rm = TRUE))
-#X with(rbi, plot(year, mean_rbi, type=&quot;l&quot;))
-#X
-#X base2 &lt;- ddply(baseball, .(id), transform, 
-#X  career_year = year - min(year) + 1
-#X )
+#' Split data frame, apply function, and return results in a data frame
+#' For each subset of a data frame, apply function then combine results into a  data frame
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits data frames
+#' by variables and combines the result into a data frame.  If there are no 
+#' results, then this function will return a data frame with zero rows and
+#' columns (\code{data.frame()}).
+#' 
+#' The most unambiguous behaviour is achieved when \code{.fun} returns a 
+#' data frame - in that case pieces will be combined with
+#' \code{\link{rbind.fill}}.  If \code{.fun} returns an atomic vector of fixed
+#' length, it will be \code{rbind}ed together and converted to a data frame.
+#' Any other values will result in an error.
+#' 
+#' 
+#' @keywords manip
+#' @param .data data frame to be processed
+#' @param .variables variables to split data frame by, as quoted variables, a formula or character vector
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return a data frame
+#' @examples
+#' ddply(baseball, .(year), &quot;nrow&quot;) 
+#' ddply(baseball, .(lg), c(&quot;nrow&quot;, &quot;ncol&quot;)) 
+#' 
+#' rbi &lt;- ddply(baseball, .(year), summarise, 
+#'   mean_rbi = mean(rbi, na.rm = TRUE))
+#' with(rbi, plot(year, mean_rbi, type=&quot;l&quot;))
+#'
+#' base2 &lt;- ddply(baseball, .(id), transform, 
+#'  career_year = year - min(year) + 1
+#' )
 ddply &lt;- function(.data, .variables, .fun = NULL, ..., .progress = &quot;none&quot;, .drop = TRUE) {
   .data &lt;- as.data.frame(.data)
   .variables &lt;- as.quoted(.variables)
@@ -70,23 +71,23 @@ ddply &lt;- function(.data, .variables, .fun = NULL, ..., .progress = &quot;none&quot;, .drop
   ldply(.data = pieces, .fun = .fun, ..., .progress = .progress)
 }
 
-# Split array, apply function, and return results in a data frame
-# For each slice of an array, apply function then combine results into a data frame
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure. This function splits matrices,
-# arrays and data frames by dimensions and combines the result into a data
-# frame. If there are no results, then this function will return a data frame
-# with zero rows and columns (\code{data.frame()}).
-# 
-# @keyword manip
-# @arguments matrix, array or data frame to be processed
-# @arguments a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value a data frame
+#' Split array, apply function, and return results in a data frame
+#' For each slice of an array, apply function then combine results into a data frame
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure. This function splits matrices,
+#' arrays and data frames by dimensions and combines the result into a data
+#' frame. If there are no results, then this function will return a data frame
+#' with zero rows and columns (\code{data.frame()}).
+#' 
+#' @keywords manip
+#' @param .data matrix, array or data frame to be processed
+#' @param .margins a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return a data frame
 adply &lt;- function(.data, .margins, .fun = NULL, ..., .progress = &quot;none&quot;) {
   pieces &lt;- splitter_a(.data, .margins)
   </diff>
      <filename>R/ply-data-frame.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,30 @@
-# Split list, apply function, and return results in a list
-# For each element of a list, apply function then combine results into a list
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits lists by
-# elements and combines the result into a list.  If there are no results, then
-# this function will return a list of length 0  (\code{list()}).
-# 
-# \code{llply} is equivalent to \code{\link{lapply}} except that it will 
-# preserve labels and can display a progress bar.
-# 
-# 
-# @keyword manip
-# @arguments list to be processed
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value list of results
-#X llply(llply(mtcars, round), table)
-#X llply(baseball, summary)
-#X # Examples from ?lapply
-#X x &lt;- list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE))
-#X
-#X llply(x, mean)
-#X llply(x, quantile, probs = 1:3/4)
+#' Split list, apply function, and return results in a list
+#' For each element of a list, apply function then combine results into a list
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits lists by
+#' elements and combines the result into a list.  If there are no results, then
+#' this function will return a list of length 0  (\code{list()}).
+#' 
+#' \code{llply} is equivalent to \code{\link{lapply}} except that it will 
+#' preserve labels and can display a progress bar.
+#' 
+#' 
+#' @keywords manip
+#' @param .data list to be processed
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return list of results
+#' @examples
+#' llply(llply(mtcars, round), table)
+#' llply(baseball, summary)
+#' # Examples from ?lapply
+#' x &lt;- list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE))
+#'
+#' llply(x, mean)
+#' llply(x, quantile, probs = 1:3/4)
 llply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;, .inform = FALSE) {
   pieces &lt;- if (inherits(.data, &quot;split&quot;)) .data else as.list(.data)
   if (is.null(.fun)) return(as.list(pieces))
@@ -70,34 +71,35 @@ llply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;, .inform = FALSE)
   result
 }
 
-# Split data frame, apply function, and return results in a list
-# For each subset of a data frame, apply function then combine results into a  list
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits data frames
-# by variables and combines the result into a list.  If there are no results,
-# then this function will return a list of length 0  (\code{list()}).
-# 
-# \code{dlply} is similar to \code{\link{by}} except that the results are 
-# returned in a different format.
-# 
-# 
-# @keyword manip
-# @arguments data frame to be processed
-# @arguments variables to split data frame by, as quoted variables, a formula or character vector
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
-#X linmod &lt;- function(df) lm(rbi ~ year, data = transform(df, year = year - min(year)))
-#X models &lt;- dlply(baseball, .(id), linmod)
-#X models[[1]]
-#X
-#X coef &lt;- ldply(models, coef)
-#X with(coef, plot(`(Intercept)`, year))
-#X qual &lt;- laply(models, function(mod) summary(mod)$r.squared)
-#X hist(qual)
+#' Split data frame, apply function, and return results in a list
+#' For each subset of a data frame, apply function then combine results into a  list
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits data frames
+#' by variables and combines the result into a list.  If there are no results,
+#' then this function will return a list of length 0  (\code{list()}).
+#' 
+#' \code{dlply} is similar to \code{\link{by}} except that the results are 
+#' returned in a different format.
+#' 
+#' 
+#' @keywords manip
+#' @param .data data frame to be processed
+#' @param .variables variables to split data frame by, as quoted variables, a formula or character vector
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
+#' @examples
+#' linmod &lt;- function(df) lm(rbi ~ year, data = transform(df, year = year - min(year)))
+#' models &lt;- dlply(baseball, .(id), linmod)
+#' models[[1]]
+#'
+#' coef &lt;- ldply(models, coef)
+#' with(coef, plot(`(Intercept)`, year))
+#' qual &lt;- laply(models, function(mod) summary(mod)$r.squared)
+#' hist(qual)
 dlply &lt;- function(.data, .variables, .fun = NULL, ..., .progress = &quot;none&quot;, .drop = TRUE) {
   .data &lt;- as.data.frame(.data)
   .variables &lt;- as.quoted(.variables)
@@ -106,29 +108,30 @@ dlply &lt;- function(.data, .variables, .fun = NULL, ..., .progress = &quot;none&quot;, .drop
   llply(.data = pieces, .fun = .fun, ..., .progress = .progress)
 }
 
-# Split array, apply function, and return results in a list
-# For each slice of an array, apply function then combine results into a list
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits matrices,
-# arrays and data frames by dimensions and combines the result into a list. 
-# If there are no results, then this function will return a list of length 0 
-# (\code{list()}).
-# 
-# \code{alply} is somewhat similar to \code{\link{apply}} for cases where the
-# results are not atomic.
-# 
-# 
-# @keyword manip
-# @arguments matrix, array or data frame to be processed
-# @arguments a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value list of results
-#X alply(ozone, 3, quantile)
-#X alply(ozone, 3, function(x) table(round(x)))
+#' Split array, apply function, and return results in a list
+#' For each slice of an array, apply function then combine results into a list
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits matrices,
+#' arrays and data frames by dimensions and combines the result into a list. 
+#' If there are no results, then this function will return a list of length 0 
+#' (\code{list()}).
+#' 
+#' \code{alply} is somewhat similar to \code{\link{apply}} for cases where the
+#' results are not atomic.
+#' 
+#' 
+#' @keywords manip
+#' @param .data matrix, array or data frame to be processed
+#' @param .margins a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return list of results
+#' @examples
+#' alply(ozone, 3, quantile)
+#' alply(ozone, 3, function(x) table(round(x)))
 alply &lt;- function(.data, .margins, .fun = NULL, ..., .progress = &quot;none&quot;) {
   pieces &lt;- splitter_a(.data, .margins)
   </diff>
      <filename>R/ply-list.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,25 +1,25 @@
-# Call function with arguments in array or data frame, returning a data frame
-# Call a multi-argument function with values taken from columns of an data frame or array, and combine results into a data frame
-# 
-# The \code{m*ply} functions are the \code{plyr} version of \code{mapply},
-# specialised according to the type of output they produce.  These functions
-# are just a convenient wrapper around \code{a*ply} with \code{margins = 1}
-# and \code{.fun} wrapped in \code{\link{splat}}.
-# 
-# This function combines the result into a data frame.  If there are no
-# results, then this function will return a data frame with zero rows and
-# columns (\code{data.frame()}).
-# 
-# 
-# @keyword manip
-# @arguments matrix or data frame to use as source of arguments
-# @arguments function to be called with varying arguments
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value a data frame
-#X mdply(data.frame(mean = 1:5, sd = 1:5), rnorm, n = 2)
-#X mdply(expand.grid(mean = 1:5, sd = 1:5), rnorm, n = 2)
-#X mdply(cbind(mean = 1:5, sd = 1:5), rnorm, n = 5)
+#' Call function with arguments in array or data frame, returning a data frame
+#' Call a multi-argument function with values taken from columns of an data frame or array, and combine results into a data frame
+#' 
+#' The \code{m*ply} functions are the \code{plyr} version of \code{mapply},
+#' specialised according to the type of output they produce.  These functions
+#' are just a convenient wrapper around \code{a*ply} with \code{margins = 1}
+#' and \code{.fun} wrapped in \code{\link{splat}}.
+#' 
+#' This function combines the result into a data frame.  If there are no
+#' results, then this function will return a data frame with zero rows and
+#' columns (\code{data.frame()}).
+#' 
+#' 
+#' @keywords manip
+#' @param .data matrix or data frame to use as source of arguments
+#' @param .fun function to be called with varying arguments
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return a data frame
+#' mdply(data.frame(mean = 1:5, sd = 1:5), rnorm, n = 2)
+#' mdply(expand.grid(mean = 1:5, sd = 1:5), rnorm, n = 2)
+#' mdply(cbind(mean = 1:5, sd = 1:5), rnorm, n = 5)
 mdply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;) {
   if (is.matrix(.data) &amp; !is.list(.data)) .data &lt;- .matrix_to_df(.data)
 
@@ -27,27 +27,27 @@ mdply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;) {
   adply(.data = .data, .margins = 1, .fun = f, ..., .progress = .progress)
 }
 
-# Call function with arguments in array or data frame, returning an array
-# Call a multi-argument function with values taken from columns of an data frame or array, and combine results into an array
-# 
-# The \code{m*ply} functions are the \code{plyr} version of \code{mapply},
-# specialised according to the type of output they produce.  These functions
-# are just a convenient wrapper around \code{a*ply} with \code{margins = 1}
-# and \code{.fun} wrapped in \code{\link{splat}}.
-# 
-# This function combines the result into an array.  If there are no results,
-# then this function will return a vector of length 0 (\code{vector()}).
-# 
-# 
-# @keyword manip
-# @arguments matrix or data frame to use as source of arguments
-# @arguments function to be called with varying arguments
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
-#X maply(cbind(mean = 1:5, sd = 1:5), rnorm, n = 5)
-#X maply(cbind(1:5, 1:5), rnorm, n = 5)
-#X maply(expand.grid(mean = 1:5, sd = 1:5), rnorm, n = 5)
+#' Call function with arguments in array or data frame, returning an array
+#' Call a multi-argument function with values taken from columns of an data frame or array, and combine results into an array
+#' 
+#' The \code{m*ply} functions are the \code{plyr} version of \code{mapply},
+#' specialised according to the type of output they produce.  These functions
+#' are just a convenient wrapper around \code{a*ply} with \code{margins = 1}
+#' and \code{.fun} wrapped in \code{\link{splat}}.
+#' 
+#' This function combines the result into an array.  If there are no results,
+#' then this function will return a vector of length 0 (\code{vector()}).
+#' 
+#' 
+#' @keywords manip
+#' @param .data matrix or data frame to use as source of arguments
+#' @param .fun function to be called with varying arguments
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
+#' maply(cbind(mean = 1:5, sd = 1:5), rnorm, n = 5)
+#' maply(cbind(1:5, 1:5), rnorm, n = 5)
+#' maply(expand.grid(mean = 1:5, sd = 1:5), rnorm, n = 5)
 maply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;) {
   if (is.matrix(.data) &amp; !is.list(.data)) .data &lt;- .matrix_to_df(.data)
   
@@ -55,30 +55,31 @@ maply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;) {
   aaply(.data = .data, .margins = 1, .fun = f, ..., .progress = .progress)
 }
 
-# Call function with arguments in array or data frame, returning a list
-# Call a multi-argument function with values taken from columns of an data frame or array, and combine results into a list
-# 
-# The \code{m*ply} functions are the \code{plyr} version of \code{mapply},
-# specialised according to the type of output they produce.  These functions
-# are just a convenient wrapper around \code{a*ply} with \code{margins = 1}
-# and \code{.fun} wrapped in \code{\link{splat}}.
-# 
-# This function combines the result into a list.  If there are no results,
-# then this function will return a list of length 0  (\code{list()}).
-# 
-# 
-# @keyword manip
-# @arguments matrix or data frame to use as source of arguments
-# @arguments function to be called with varying arguments
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value list of results
-#X mlply(cbind(1:4, 4:1), rep)
-#X mlply(cbind(1:4, times = 4:1), rep)
-#X 
-#X mlply(cbind(1:4, 4:1), seq)
-#X mlply(cbind(1:4, length = 4:1), seq)
-#X mlply(cbind(1:4, by = 4:1), seq, to = 20)
+#' Call function with arguments in array or data frame, returning a list
+#' Call a multi-argument function with values taken from columns of an data frame or array, and combine results into a list
+#' 
+#' The \code{m*ply} functions are the \code{plyr} version of \code{mapply},
+#' specialised according to the type of output they produce.  These functions
+#' are just a convenient wrapper around \code{a*ply} with \code{margins = 1}
+#' and \code{.fun} wrapped in \code{\link{splat}}.
+#' 
+#' This function combines the result into a list.  If there are no results,
+#' then this function will return a list of length 0  (\code{list()}).
+#' 
+#' 
+#' @keywords manip
+#' @param .data matrix or data frame to use as source of arguments
+#' @param .fun function to be called with varying arguments
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return list of results
+#' @examples
+#' mlply(cbind(1:4, 4:1), rep)
+#' mlply(cbind(1:4, times = 4:1), rep)
+#' 
+#' mlply(cbind(1:4, 4:1), seq)
+#' mlply(cbind(1:4, length = 4:1), seq)
+#' mlply(cbind(1:4, by = 4:1), seq, to = 20)
 mlply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;) {
   if (is.matrix(.data) &amp; !is.list(.data)) .data &lt;- .matrix_to_df(.data)
 
@@ -86,22 +87,22 @@ mlply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;) {
   alply(.data = .data, .margins = 1, .fun = f, ..., .progress = .progress)
 }
 
-# Call function with arguments in array or data frame, discarding results
-# Call a multi-argument function with values taken from columns of an data frame or array, and discard results
-# 
-# The \code{m*ply} functions are the \code{plyr} version of \code{mapply},
-# specialised according to the type of output they produce.  These functions
-# are just a convenient wrapper around \code{a*ply} with \code{margins = 1}
-# and \code{.fun} wrapped in \code{\link{splat}}.
-# 
-# This function combines the result into a list.  If there are no results,
-# then this function will return a list of length 0  (\code{list()}).
-# 
-# @keyword manip
-# @arguments matrix or data frame to use as source of arguments
-# @arguments function to be called with varying arguments
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' Call function with arguments in array or data frame, discarding results
+#' Call a multi-argument function with values taken from columns of an data frame or array, and discard results
+#' 
+#' The \code{m*ply} functions are the \code{plyr} version of \code{mapply},
+#' specialised according to the type of output they produce.  These functions
+#' are just a convenient wrapper around \code{a*ply} with \code{margins = 1}
+#' and \code{.fun} wrapped in \code{\link{splat}}.
+#' 
+#' This function combines the result into a list.  If there are no results,
+#' then this function will return a list of length 0  (\code{list()}).
+#' 
+#' @keywords manip
+#' @param .data matrix or data frame to use as source of arguments
+#' @param .fun function to be called with varying arguments
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
 m_ply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;) {
   if (is.matrix(.data) &amp; !is.list(.data)) .data &lt;- .matrix_to_df(.data)
 </diff>
      <filename>R/ply-mapply.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,19 @@
-# Split list, apply function, and discard results
-# For each element of a list, apply function and discard results
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits lists by
-# elements and discards the output.  This is useful for functions that you are 
-# calling purely for their side effects like display plots and saving output.
-# 
-# 
-# @keyword manip
-# @arguments list to be processed
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @argument automatically print each result? (default: \code{FALSE})
+#' Split list, apply function, and discard results
+#' For each element of a list, apply function and discard results
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits lists by
+#' elements and discards the output.  This is useful for functions that you are 
+#' calling purely for their side effects like display plots and saving output.
+#' 
+#' 
+#' @keywords manip
+#' @param .data list to be processed
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @param automatically print each result? (default: \code{FALSE})
 l_ply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;, .print = FALSE) {
   if (is.character(.fun)) .fun &lt;- do.call(&quot;each&quot;, as.list(.fun))
   if (!is.function(.fun)) stop(&quot;.fun is not a function.&quot;)
@@ -32,24 +32,24 @@ l_ply &lt;- function(.data, .fun = NULL, ..., .progress = &quot;none&quot;, .print = FALSE) {
   invisible()
 }
 
-# Split data frame, apply function, and discard results
-# For each subset of a data frame, apply function and discard results
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits data frames
-# by variable and discards the output.  This is useful for functions that you
-# are calling purely for their side effects like display plots and saving
-# output.
-# 
-# 
-# @keyword manip
-# @arguments data frame to be processed
-# @arguments variables to split data frame by, as quoted variables, a formula or character vector
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @argument automatically print each result? (default: \code{FALSE})
+#' Split data frame, apply function, and discard results
+#' For each subset of a data frame, apply function and discard results
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits data frames
+#' by variable and discards the output.  This is useful for functions that you
+#' are calling purely for their side effects like display plots and saving
+#' output.
+#' 
+#' 
+#' @keywords manip
+#' @param .data data frame to be processed
+#' @param .variables variables to split data frame by, as quoted variables, a formula or character vector
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @param automatically print each result? (default: \code{FALSE})
 d_ply &lt;- function(.data, .variables, .fun = NULL, ..., .progress = &quot;none&quot;, .print = FALSE) {
   .data &lt;- as.data.frame(.data)
   .variables &lt;- as.quoted(.variables)
@@ -58,24 +58,24 @@ d_ply &lt;- function(.data, .variables, .fun = NULL, ..., .progress = &quot;none&quot;, .prin
   l_ply(.data = pieces, .fun = .fun, ..., .progress = .progress, .print = .print)
 }
 
-# Split array, apply function, and discard results
-# For each slice of an array, apply function and discard results
-# 
-# All plyr functions use the same split-apply-combine strategy: they split the
-# input into simpler pieces, apply \code{.fun} to each piece, and then combine
-# the pieces into a single data structure.  This function splits matrices,
-# arrays and data frames by dimensions and discards the output.  This is
-# useful for functions that you are calling purely for their side effects like
-# display plots and saving output.
-# 
-# 
-# @keyword manip
-# @arguments matrix, array or data frame to be processed
-# @arguments a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
-# @arguments function to apply to each piece
-# @arguments other arguments passed on to \code{.fun}
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @argument automatically print each result? (default: \code{FALSE})
+#' Split array, apply function, and discard results
+#' For each slice of an array, apply function and discard results
+#' 
+#' All plyr functions use the same split-apply-combine strategy: they split the
+#' input into simpler pieces, apply \code{.fun} to each piece, and then combine
+#' the pieces into a single data structure.  This function splits matrices,
+#' arrays and data frames by dimensions and discards the output.  This is
+#' useful for functions that you are calling purely for their side effects like
+#' display plots and saving output.
+#' 
+#' 
+#' @keywords manip
+#' @param .data matrix, array or data frame to be processed
+#' @param .margins a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
+#' @param .fun function to apply to each piece
+#' @param ... other arguments passed on to \code{.fun}
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @param automatically print each result? (default: \code{FALSE})
 a_ply &lt;- function(.data, .margins, .fun = NULL, ..., .progress = &quot;none&quot;, .print = FALSE) {
   pieces &lt;- splitter_a(.data, .margins)
   </diff>
      <filename>R/ply-null.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,20 @@
-# Replicate expression and return results in a list
-# Evalulate expression n times then combine results into a list
-# 
-# This function runs an expression multiple times, and combines the 
-# result into a list.  If there are no results, then this function will return
-# a list of length 0  (\code{list()}). This function is equivalent to
-# \code{\link{replicate}}, but will always return results as a list.
-# 
-# 
-# @keyword manip
-# @arguments number of times to evaluate the expression
-# @arguments expression to evaluate
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value list of results
-#
-#X mods &lt;- rlply(100, lm(y ~ x, data=data.frame(x=rnorm(100), y=rnorm(100))))
-#X hist(laply(mods, function(x) summary(x)$r.squared))
+#' Replicate expression and return results in a list
+#' Evalulate expression n times then combine results into a list
+#' 
+#' This function runs an expression multiple times, and combines the 
+#' result into a list.  If there are no results, then this function will return
+#' a list of length 0  (\code{list()}). This function is equivalent to
+#' \code{\link{replicate}}, but will always return results as a list.
+#' 
+#' 
+#' @keywords manip
+#' @param .n number of times to evaluate the expression
+#' @param .expr expression to evaluate
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return list of results
+#' @examples
+#' mods &lt;- rlply(100, lm(y ~ x, data=data.frame(x=rnorm(100), y=rnorm(100))))
+#' hist(laply(mods, function(x) summary(x)$r.squared))
 rlply &lt;- function(.n, .expr, .progress = &quot;none&quot;) {
   if (is.function(.expr)) {
     f &lt;- .expr
@@ -35,25 +35,25 @@ rlply &lt;- function(.n, .expr, .progress = &quot;none&quot;) {
   result
 }
 
-# Replicate expression and return results in a data frame
-# Evalulate expression n times then combine results into a data frame
-# 
-# This function runs an expression multiple times, and combines the 
-# result into a data frame.  If there are no results, then this function
-# returns a data frame with zero rows and columns (\code{data.frame()}).
-# This function is equivalent to \code{\link{replicate}}, but will always
-# return results as a data frame.
-# 
-# 
-# @keyword manip
-# @arguments number of times to evaluate the expression
-# @arguments expression to evaluate
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value a data frame
-#X
-#X rdply(20, mean(runif(100)))
-#X rdply(20, each(mean, var)(runif(100)))
-#X rdply(20, data.frame(x = runif(2)))
+#' Replicate expression and return results in a data frame
+#' Evalulate expression n times then combine results into a data frame
+#' 
+#' This function runs an expression multiple times, and combines the 
+#' result into a data frame.  If there are no results, then this function
+#' returns a data frame with zero rows and columns (\code{data.frame()}).
+#' This function is equivalent to \code{\link{replicate}}, but will always
+#' return results as a data frame.
+#' 
+#' 
+#' @keywords manip
+#' @param .n number of times to evaluate the expression
+#' @param .expr expression to evaluate
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return a data frame
+#' @examples
+#' rdply(20, mean(runif(100)))
+#' rdply(20, each(mean, var)(runif(100)))
+#' rdply(20, data.frame(x = runif(2)))
 rdply &lt;- function(.n, .expr, .progress = &quot;none&quot;) {
   if (is.function(.expr)) {
     f &lt;- .expr
@@ -67,32 +67,31 @@ rdply &lt;- function(.n, .expr, .progress = &quot;none&quot;) {
 }
 
 
-# Replicate expression and return results in a array
-# Evalulate expression n times then combine results into an array
-# 
-# This function runs an expression multiple times, and combines the 
-# result into a data frame.  If there are no results, then this function
-# returns a vector of length 0 (\code{vector(0)}).
-# This function is equivalent to \code{\link{replicate}}, but will always
-# return results as a vector, matrix or array.
-# 
-# 
-# @keyword manip
-# @arguments number of times to evaluate the expression
-# @arguments expression to evaluate
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @value if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
-#
-#X raply(100, mean(runif(100)))
-#X raply(100, each(mean, var)(runif(100)))
-#X
-#X raply(10, runif(4))
-#X raply(10, matrix(runif(4), nrow=2))
-#X 
-#X # See the central limit theorem in action
-#X hist(raply(1000, mean(rexp(10))))
-#X hist(raply(1000, mean(rexp(100))))
-#X hist(raply(1000, mean(rexp(1000))))
+#' Replicate expression and return results in a array
+#' Evalulate expression n times then combine results into an array
+#' 
+#' This function runs an expression multiple times, and combines the 
+#' result into a data frame.  If there are no results, then this function
+#' returns a vector of length 0 (\code{vector(0)}).
+#' This function is equivalent to \code{\link{replicate}}, but will always
+#' return results as a vector, matrix or array.
+#' 
+#' @keywords manip
+#' @param .n number of times to evaluate the expression
+#' @param .expr expression to evaluate
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @return if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
+#' @examples
+#' raply(100, mean(runif(100)))
+#' raply(100, each(mean, var)(runif(100)))
+#'
+#' raply(10, runif(4))
+#' raply(10, matrix(runif(4), nrow=2))
+#' 
+#' # See the central limit theorem in action
+#' hist(raply(1000, mean(rexp(10))))
+#' hist(raply(1000, mean(rexp(100))))
+#' hist(raply(1000, mean(rexp(1000))))
 raply &lt;- function(.n, .expr, .progress = &quot;none&quot;, .drop = TRUE) {
   if (is.function(.expr)) {
     f &lt;- .expr
@@ -104,22 +103,21 @@ raply &lt;- function(.n, .expr, .progress = &quot;none&quot;, .drop = TRUE) {
   list_to_array(res, NULL, .drop)
 }
 
-# Replicate expression and discard results
-# Evalulate expression n times then discard results
-# 
-# This function runs an expression multiple times, discarding the results. 
-# This function is equivalent to \code{\link{replicate}}, but never returns
-# anything
-# 
-# 
-# @keyword manip
-# @arguments number of times to evaluate the expression
-# @arguments expression to evaluate
-# @arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
-# @argument automatically print each result? (default: \code{FALSE})
-# 
-#X r_ply(10, plot(runif(50)))
-#X r_ply(25, hist(runif(1000)))
+#' Replicate expression and discard results
+#' Evalulate expression n times then discard results
+#' 
+#' This function runs an expression multiple times, discarding the results. 
+#' This function is equivalent to \code{\link{replicate}}, but never returns
+#' anything
+#' 
+#' @keywords manip
+#' @param .n number of times to evaluate the expression
+#' @param .expr expression to evaluate
+#' @param .progress name of the progress bar to use, see \code{\link{create_progress_bar}}
+#' @param automatically print each result? (default: \code{FALSE})
+#' @examples
+#' r_ply(10, plot(runif(50)))
+#' r_ply(25, hist(runif(1000)))
 r_ply &lt;- function(.n, .expr, .progress = &quot;none&quot;, .print = FALSE) {
   if (is.function(.expr)) {
     f &lt;- .expr</diff>
      <filename>R/ply-replicate.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,44 +1,46 @@
-# Create progress bar
-# Create progress bar object from text string.
-# 
-# Progress bars give feedback on how apply step is proceeding.  This
-# is mainly useful for long running functions, as for short functions, the 
-# time taken up by splitting and combining may be on the same order (or 
-# longer) as the apply step.  Additionally, for short functions, the time
-# needed to update the progress bar can significantly slow down the process.
-# For the trivial examples below, using the tk progress bar slows things down
-# by a factor of a thousand.
-# 
-# Note the that progress bar is approximate, and if the time taken by
-# individual function applications is highly non-uniform it may not be very
-# informative of the time left.
-# 
-# There are currently four types of progress bar:  &quot;none&quot;, &quot;text&quot;, &quot;tk&quot;, and
-# &quot;win&quot;.  See the individual documentation for more details.  In plyr 
-# functions, these can either be specified by name, or you can create the
-# progress bar object yourself if you want more control over its apperance.
-# See the examples.
-# 
-# @arguments type of progress bar to create
-# @seealso \code{\link{progress_none}}, \code{\link{progress_text}}, \code{\link{progress_tk}}, \code{\link{progress_win}}
-# @keyword utilities
-#X l_ply(1:1000, identity, .progress = &quot;none&quot;)
-#X l_ply(1:1000, identity, .progress = &quot;tk&quot;)
-#X l_ply(1:1000, identity, .progress = &quot;text&quot;)
-#X l_ply(1:1000, identity, .progress = progress_text(char = &quot;-&quot;))
+#' Create progress bar
+#' Create progress bar object from text string.
+#' 
+#' Progress bars give feedback on how apply step is proceeding.  This
+#' is mainly useful for long running functions, as for short functions, the 
+#' time taken up by splitting and combining may be on the same order (or 
+#' longer) as the apply step.  Additionally, for short functions, the time
+#' needed to update the progress bar can significantly slow down the process.
+#' For the trivial examples below, using the tk progress bar slows things down
+#' by a factor of a thousand.
+#' 
+#' Note the that progress bar is approximate, and if the time taken by
+#' individual function applications is highly non-uniform it may not be very
+#' informative of the time left.
+#' 
+#' There are currently four types of progress bar:  &quot;none&quot;, &quot;text&quot;, &quot;tk&quot;, and
+#' &quot;win&quot;.  See the individual documentation for more details.  In plyr 
+#' functions, these can either be specified by name, or you can create the
+#' progress bar object yourself if you want more control over its apperance.
+#' See the examples.
+#' 
+#' @param name type of progress bar to create
+#' @seealso \code{\link{progress_none}}, \code{\link{progress_text}}, \code{\link{progress_tk}}, \code{\link{progress_win}}
+#' @keywords utilities
+#' @examples
+#' l_ply(1:1000, identity, .progress = &quot;none&quot;)
+#' l_ply(1:1000, identity, .progress = &quot;tk&quot;)
+#' l_ply(1:1000, identity, .progress = &quot;text&quot;)
+#' l_ply(1:1000, identity, .progress = progress_text(char = &quot;-&quot;))
 create_progress_bar &lt;- function(name = &quot;none&quot;) {
   if (!is.character(name)) return(name)
   match.fun(paste(&quot;progress&quot;, name, sep=&quot;_&quot;))()
 }
 
-# Null progress bar
-# A progress bar that does nothing
-# 
-# This the default progress bar used by plyr functions.  It's very simple to
-# understand - it does nothing!
-# 
-# @keyword internal
-#X l_ply(1:100, identity, .progress = &quot;none&quot;)
+#' Null progress bar
+#' A progress bar that does nothing
+#' 
+#' This the default progress bar used by plyr functions.  It's very simple to
+#' understand - it does nothing!
+#' 
+#' @keywords internal
+#' @examples
+#' l_ply(1:100, identity, .progress = &quot;none&quot;)
 progress_none &lt;- function() {
   list(
     init = function(x) {},
@@ -47,16 +49,18 @@ progress_none &lt;- function() {
   )
 }
 
-# Text progress bar
-# A textual progress bar
-# 
-# This progress bar displays a textual progress bar that works on all 
-# platforms.  It is a thin wrapper around the built-in 
-# \code{\link{setTxtProgressBar}} and can be customised in the same way.
-#
-# @argument style of text bar, see Details section of \code{\link{txtProgressBar}}
-#X l_ply(1:1000, identity, .progress = &quot;text&quot;)
-#X l_ply(1:1000, identity, .progress = progress_text(char = &quot;-&quot;))
+#' Text progress bar
+#' A textual progress bar
+#' 
+#' This progress bar displays a textual progress bar that works on all 
+#' platforms.  It is a thin wrapper around the built-in 
+#' \code{\link{setTxtProgressBar}} and can be customised in the same way.
+#'
+#' @param style style of text bar, see Details section of \code{\link{txtProgressBar}}
+#' @param ... other arugments passed on to \code{\link{txtProgressBar}}
+#' @examples
+#' l_ply(1:1000, identity, .progress = &quot;text&quot;)
+#' l_ply(1:1000, identity, .progress = progress_text(char = &quot;-&quot;))
 progress_text &lt;- function(style = 3, ...) {
   n &lt;- 0
   txt &lt;- NULL
@@ -74,18 +78,19 @@ progress_text &lt;- function(style = 3, ...) {
   )
 }
 
-# Graphical progress bar, powered by Tk
-# A graphical progress bar displayed in a Tk window
-# 
-# This graphical progress will appear in a separate window.
-# 
-# @arguments window title
-# @arguments progress bar label (inside window)
-# @arguments other arguments passed on to \code{\link[tcltk]{tkProgressBar}}
-# @seealso \code{\link[tcltk]{tkProgressBar}} for the function that powers this progress bar
-#X l_ply(1:1000, identity, .progress = &quot;tk&quot;)
-#X l_ply(1:1000, identity, .progress = progress_tk(width=400))
-#X l_ply(1:1000, identity, .progress = progress_tk(label=&quot;&quot;))
+#' Graphical progress bar, powered by Tk
+#' A graphical progress bar displayed in a Tk window
+#' 
+#' This graphical progress will appear in a separate window.
+#' 
+#' @param title window title
+#' @param lable progress bar label (inside window)
+#' @param ... other arguments passed on to \code{\link[tcltk]{tkProgressBar}}
+#' @seealso \code{\link[tcltk]{tkProgressBar}} for the function that powers this progress bar
+#' @examples
+#' l_ply(1:1000, identity, .progress = &quot;tk&quot;)
+#' l_ply(1:1000, identity, .progress = progress_tk(width=400))
+#' l_ply(1:1000, identity, .progress = progress_tk(label=&quot;&quot;))
 progress_tk &lt;- function(title = &quot;plyr progress&quot;, label = &quot;Working...&quot;, ...) {
   stopifnot(require(&quot;tcltk&quot;, quiet=TRUE))
   n &lt;- 0
@@ -104,18 +109,19 @@ progress_tk &lt;- function(title = &quot;plyr progress&quot;, label = &quot;Working...&quot;, ...) {
   )
 }
 
-# Graphical progress bar, powered by Windows
-# A graphical progress bar displayed in a separate window
-# 
-# This graphical progress only works on Windows.
-# 
-# @arguments window title
-# @arguments other arguments passed on to \code{\link[utils]{winProgressBar}}
-# @seealso \code{\link[utils]{winProgressBar}} for the function that powers this progress bar
-#X if(exists(&quot;winProgressBar&quot;)) {
-#X l_ply(1:1000, identity, .progress = &quot;win&quot;)
-#X l_ply(1:1000, identity, .progress = progress_win(title=&quot;Working...&quot;))
-#X }
+#' Graphical progress bar, powered by Windows
+#' A graphical progress bar displayed in a separate window
+#' 
+#' This graphical progress only works on Windows.
+#' 
+#' @param title window title
+#' @param ... other arguments passed on to \code{\link[utils]{winProgressBar}}
+#' @seealso \code{\link[utils]{winProgressBar}} for the function that powers this progress bar
+#' @examples
+#' if(exists(&quot;winProgressBar&quot;)) {
+#' l_ply(1:1000, identity, .progress = &quot;win&quot;)
+#' l_ply(1:1000, identity, .progress = progress_win(title=&quot;Working...&quot;))
+#' }
 progress_win &lt;- function(title = &quot;plyr progress&quot;, ...) {
   n &lt;- 0
   win &lt;- NULL</diff>
      <filename>R/progress.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,51 +1,52 @@
-# Quote variables
-# Create a list of unevaluated expressions for later evaluation
-# 
-# This function is similar to \code{\link{~}} in that it is used to
-# capture the name of variables, not their current value.  This is used
-# throughout plyr to specify the names of variables (or more complicated
-# expressions).
-# 
-# Similar tricks can be performed with \code{\link{substitute}}, but when
-# functions can be called in multiple ways it becomes increasingly tricky
-# to ensure that the values are extracted from the correct frame.  Substitute
-# tricks also make it difficult to program against the functions that use
-# them, while the \code{quoted} class provides 
-# \code{\link{as.quoted.character}} to convert strings to the appropriate
-# data structure.
-# 
-# @arguments unevaluated expressions to be recorded.  Specify names if you want the set the names of the resultant variables
-# @value list of symbol and language primitives
-# @alias quoted
-#X .(a, b, c)
-#X .(first = a, second = b, third = c)
-#X .(a ^ 2, b - d, log(c))
-#X as.quoted(~ a + b + c)
-#X as.quoted(a ~ b + c)
-#X as.quoted(c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;))
-#X 
-#X # Some examples using ddply - look at the column names
-#X ddply(mtcars, &quot;cyl&quot;, each(nrow, ncol))
-#X ddply(mtcars, ~ cyl, each(nrow, ncol))
-#X ddply(mtcars, .(cyl), each(nrow, ncol))
-#X ddply(mtcars, .(log(cyl)), each(nrow, ncol))
-#X ddply(mtcars, .(logcyl = log(cyl)), each(nrow, ncol))
-#X ddply(mtcars, .(vs + am), each(nrow, ncol))
-#X ddply(mtcars, .(vsam = vs + am), each(nrow, ncol))
+#' Quote variables
+#' Create a list of unevaluated expressions for later evaluation
+#' 
+#' This function is similar to \code{\link{~}} in that it is used to
+#' capture the name of variables, not their current value.  This is used
+#' throughout plyr to specify the names of variables (or more complicated
+#' expressions).
+#' 
+#' Similar tricks can be performed with \code{\link{substitute}}, but when
+#' functions can be called in multiple ways it becomes increasingly tricky
+#' to ensure that the values are extracted from the correct frame.  Substitute
+#' tricks also make it difficult to program against the functions that use
+#' them, while the \code{quoted} class provides 
+#' \code{\link{as.quoted.character}} to convert strings to the appropriate
+#' data structure.
+#' 
+#' @param ... unevaluated expressions to be recorded.  Specify names if you want the set the names of the resultant variables
+#' @return list of symbol and language primitives
+#' @aliases . quoted
+#' @examples
+#' .(a, b, c)
+#' .(first = a, second = b, third = c)
+#' .(a ^ 2, b - d, log(c))
+#' as.quoted(~ a + b + c)
+#' as.quoted(a ~ b + c)
+#' as.quoted(c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;))
+#' 
+#' # Some examples using ddply - look at the column names
+#' ddply(mtcars, &quot;cyl&quot;, each(nrow, ncol))
+#' ddply(mtcars, ~ cyl, each(nrow, ncol))
+#' ddply(mtcars, .(cyl), each(nrow, ncol))
+#' ddply(mtcars, .(log(cyl)), each(nrow, ncol))
+#' ddply(mtcars, .(logcyl = log(cyl)), each(nrow, ncol))
+#' ddply(mtcars, .(vs + am), each(nrow, ncol))
+#' ddply(mtcars, .(vsam = vs + am), each(nrow, ncol))
 . &lt;- function(...) {
   structure(as.list(match.call()[-1]), class=&quot;quoted&quot;)
 }
 
-# Print quoted variables
-# Display the \code{\link{str}}ucture of quoted variables
-# 
-# @keyword internal
+#' Print quoted variables
+#' Display the \code{\link{str}}ucture of quoted variables
+#' 
+#' @keywords internal
 print.quoted &lt;- function(x, ...) str(x)
 
-# Compute names of quoted variables
-# Figure out names of quoted variables, using specified names if they exist, otherwise using \code{\link{make.names}} on the values.
-# 
-# @keyword internal
+#' Compute names of quoted variables
+#' Figure out names of quoted variables, using specified names if they exist, otherwise using \code{\link{make.names}} on the values.
+#' 
+#' @keywords internal
 names.quoted &lt;- function(x) {
   part_names &lt;- make.names(x)
   user_names &lt;- names(unclass(x))
@@ -57,11 +58,11 @@ names.quoted &lt;- function(x) {
   part_names
 }
 
-# Evaluate a quoted list of variables 
-# Evaluates quoted variables in specified environment
-# 
-# @value a list
-# @keyword internal
+#' Evaluate a quoted list of variables 
+#' Evaluates quoted variables in specified environment
+#' 
+#' @return a list
+#' @keywords internal
 eval.quoted &lt;- function(exprs,  envir = parent.frame(), enclos = if (is.list(envir) || is.pairlist(envir)) parent.frame() else baseenv()) {
   
   if (is.numeric(exprs)) return(envir[exprs])
@@ -72,27 +73,22 @@ eval.quoted &lt;- function(exprs,  envir = parent.frame(), enclos = if (is.list(env
   results
 }
 
-# Convert input to quoted variables
-# Convert characters, formulas and calls to quoted .variables
-# 
-# This method is called by default on all plyr functions that take a 
-# \code{.variables} argument, so that equivalent forms can be used anywhere.
-# 
-# Currently conversions exist for character vectors, formulas and 
-# call objects.
-# 
-# @value a list of quoted variables
-# @seealso \code{\link{.}}
-# @alias as.quoted.call
-# @alias as.quoted.character
-# @alias as.quoted.formula
-# @alias as.quoted.quoted
-# @alias as.quoted.NULL
-# @alias as.quoted.numeric
-# @alias c.quoted
-# @alais as.quoted.NULL
-#X as.quoted(c(&quot;a&quot;, &quot;b&quot;, &quot;log(d)&quot;))
-#X as.quoted(a ~ b + log(d))
+#' Convert input to quoted variables
+#' Convert characters, formulas and calls to quoted .variables
+#' 
+#' This method is called by default on all plyr functions that take a 
+#' \code{.variables} argument, so that equivalent forms can be used anywhere.
+#' 
+#' Currently conversions exist for character vectors, formulas and 
+#' call objects.
+#' 
+#' @return a list of quoted variables
+#' @seealso \code{\link{.}}
+#' @aliases as.quoted.call as.quoted.character as.quoted.formula
+#'  as.quoted.quoted as.quoted.NULL as.quoted.numeric c.quoted as.quoted
+#' @examples
+#' as.quoted(c(&quot;a&quot;, &quot;b&quot;, &quot;log(d)&quot;))
+#' as.quoted(a ~ b + log(d))
 as.quoted &lt;- function(x) UseMethod(&quot;as.quoted&quot;)
 as.quoted.call &lt;- function(x) structure(as.list(x)[-1], class=&quot;quoted&quot;)
 as.quoted.character &lt;- function(x) {
@@ -135,8 +131,8 @@ c.quoted &lt;- function(..., recursive = FALSE) {
   structure(NextMethod(&quot;c&quot;), class = &quot;quoted&quot;)
 }
 
-# Is a formula?
-# Checks if argument is a formula
-# 
-# @keyword internal
+#' Is a formula?
+#' Checks if argument is a formula
+#' 
+#' @keywords internal
 is.formula &lt;- function(x) inherits(x, &quot;formula&quot;)</diff>
      <filename>R/quote.r</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,10 @@
 # This is a minor enhancement to \code{\link{rbind}} which adds in columns
 # that are not present in all inputs.
 # 
-# @arguments data frames to row bind together
-# @keyword manip
+#' @param ... data frames to row bind together
+#' @keywords manip
+#' @examples
+#' rbind.fill(mtcars[c(&quot;mpg&quot;, &quot;wt&quot;)], mtcars[c(&quot;wt&quot;, &quot;cyl&quot;)])
 rbind.fill &lt;- function(...) {
   dfs &lt;- list(...)
   if (length(dfs) == 0) return(list())
@@ -63,17 +65,18 @@ rbind.fill &lt;- function(...) {
   as_df(output)
 }
 
-# Compact list
-# Remove all NULL entries from a list
-# 
-# @arguments list
-# @keyword manip 
+#' Compact list
+#' Remove all NULL entries from a list
+#' 
+#' @param l list
+#' @keywords manip 
 compact &lt;- function(l) Filter(Negate(is.null), l)
 
-# Convert list to data frame
-# Works like cbind, but crams everything into a column
-# 
-# @keyword internal
+#' Convert list to data frame
+#' Works like cbind, but crams everything into a column
+#' 
+#' @param output output list to turn into a data frame
+#' @keywords internal
 as_df &lt;- function(output) {
   if (length(output) == 0) return(data.frame())
   # Convert list to data.frame</diff>
      <filename>R/rbind.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,11 @@
 
-# List to array
-# Reduce/simplify a list of homogenous objects to an array
-# 
-# @arguments list of input data
-# @arguments a data frame of labels, one row for each element of res
-# @arguments should extra dimensions be dropped (TRUE) or preserved (FALSE)
-# @keyword internal
+#' List to array
+#' Reduce/simplify a list of homogenous objects to an array
+#' 
+#' @param res list of input data
+#' @param labels a data frame of labels, one row for each element of res
+#' @param .drop should extra dimensions be dropped (TRUE) or preserved (FALSE)
+#' @keywords internal
 list_to_array &lt;- function(res, labels = NULL, .drop = FALSE) {
   if (length(res) == 0) return(vector())
   n &lt;- length(res)</diff>
      <filename>R/simplify-array.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,9 @@
-# List to data frame
-# Reduce/simplify a list of homogenous objects to a data frame
-# 
-# @arguments list of input data
-# @arguments a data frame of labels, one row for each element of res
-# @keyword internal
+#' List to data frame
+#' Reduce/simplify a list of homogenous objects to a data frame
+#' 
+#' @param res list of input data
+#' @param labels a data frame of labels, one row for each element of res
+#' @keywords internal
 list_to_dataframe &lt;- function(res, labels = NULL) { 
   if (length(res) == 0) return(data.frame())
   </diff>
      <filename>R/simplify-data-frame.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
-# List to vector
-# Reduce/simplify a list of homogenous objects to a vector
-# 
-# @arguments list of input data
-# @keyword internal
+#' List to vector
+#' Reduce/simplify a list of homogenous objects to a vector
+#' 
+#' @param res list of input data
+#' @keywords internal
 list_to_vector &lt;- function(res) {
   n &lt;- length(res)
   if (n == 0) return(vector())</diff>
      <filename>R/simplify-vector.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,26 +1,27 @@
-# Split an array by .margins
-# Split a 2d or higher data structure into lower-d pieces based
-# 
-# This is the workhorse of the \code{a*ply} functions.  Given a &gt;1 d 
-# data structure (matrix, array, data.frame), it splits it into pieces
-# based on the subscripts that you supply.  Each piece is a lower dimensional
-# slice.
-# 
-# The margins are specified in the same way as \code{\link{apply}}, but
-# \code{splitter_a} just splits up the data, while \code{apply} also
-# applies a function and combines the pieces back together.  This function
-# also includes enough information to recreate the split from attributes on
-# the list of pieces.
-# 
-# @params &gt;1d data structure (matrix, data.frame or array)
-# @params a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns
-# @value a list of lower-d slices, with attributes that record split details
-#X splitter_a(mtcars, 1)
-#X splitter_a(mtcars, 2)
-#X
-#X splitter_a(ozone, 2)
-#X splitter_a(ozone, 3)
-#X splitter_a(ozone, 1:2)
+#' Split an array by .margins
+#' Split a 2d or higher data structure into lower-d pieces based
+#' 
+#' This is the workhorse of the \code{a*ply} functions.  Given a &gt;1 d 
+#' data structure (matrix, array, data.frame), it splits it into pieces
+#' based on the subscripts that you supply.  Each piece is a lower dimensional
+#' slice.
+#' 
+#' The margins are specified in the same way as \code{\link{apply}}, but
+#' \code{splitter_a} just splits up the data, while \code{apply} also
+#' applies a function and combines the pieces back together.  This function
+#' also includes enough information to recreate the split from attributes on
+#' the list of pieces.
+#' 
+#' @param data &gt;1d data structure (matrix, data.frame or array)
+#' @param .margins a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns
+#' @return a list of lower-d slices, with attributes that record split details
+#' @examples
+#' splitter_a(mtcars, 1)
+#' splitter_a(mtcars, 2)
+#'
+#' splitter_a(ozone, 2)
+#' splitter_a(ozone, 3)
+#' splitter_a(ozone, 1:2)
 splitter_a &lt;- function(data, .margins = 1) {
   if (!all(.margins %in% seq_len(dims(data)))) stop(&quot;Invalid margin&quot;)
   </diff>
      <filename>R/split-array.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,38 +1,41 @@
-# Split a data frame by variables
-# Split a data frame into pieces based on variable contained in that data frame
-# 
-# This is the workhorse of the \code{d*ply} functions.  Based on the variables
-# you supply, it breaks up a single data frame into a list of data frames,
-# each containing a single combination from the levels of the specified
-# variables.
-# 
-# This is basically a thin wrapper around \code{\link{split}} which
-# evaluates the variables in the context of the data, and includes enough
-# information to reconstruct the labelling of the data frame after 
-# other operations.
-# 
-# @seealso \code{\link{.}} for quoting variables, \code{\link{split}}
-# @arguments data frame
-# @arguments a \link{quoted} list of variables, a formula, or character vector
-# @value a list of data.frames, with attributes that record split details
-#X splitter_d(mtcars, .(cyl))
-#X splitter_d(mtcars, .(vs, am))
-#X splitter_d(mtcars, .(am, vs))
-#X
-#X mtcars$cyl2 &lt;- factor(mtcars$cyl, levels = c(2, 4, 6, 8, 10))
-#X splitter_d(mtcars, .(cyl2), drop = TRUE)
-#X splitter_d(mtcars, .(cyl2), drop = FALSE)
-#X
-#X mtcars$cyl3 &lt;- ifelse(mtcars$vs == 1, NA, mtcars$cyl)
-#X splitter_d(mtcars, .(cyl3))
-#X splitter_d(mtcars, .(cyl3, vs))
-#X splitter_d(mtcars, .(cyl3, vs), drop = FALSE)
+#' Split a data frame by variables
+#' Split a data frame into pieces based on variable contained in that data frame
+#' 
+#' This is the workhorse of the \code{d*ply} functions.  Based on the variables
+#' you supply, it breaks up a single data frame into a list of data frames,
+#' each containing a single combination from the levels of the specified
+#' variables.
+#' 
+#' This is basically a thin wrapper around \code{\link{split}} which
+#' evaluates the variables in the context of the data, and includes enough
+#' information to reconstruct the labelling of the data frame after 
+#' other operations.
+#' 
+#' @seealso \code{\link{.}} for quoting variables, \code{\link{split}}
+#' @param data data frame
+#' @param .variables a \link{quoted} list of variables, a formula, or character vector
+#' @param .drop drop unnused factor levels?
+#' @return a list of data.frames, with attributes that record split details
+#' @examples
+#' splitter_d(mtcars, .(cyl))
+#' splitter_d(mtcars, .(vs, am))
+#' splitter_d(mtcars, .(am, vs))
+#'
+#' mtcars$cyl2 &lt;- factor(mtcars$cyl, levels = c(2, 4, 6, 8, 10))
+#' splitter_d(mtcars, .(cyl2), drop = TRUE)
+#' splitter_d(mtcars, .(cyl2), drop = FALSE)
+#'
+#' mtcars$cyl3 &lt;- ifelse(mtcars$vs == 1, NA, mtcars$cyl)
+#' splitter_d(mtcars, .(cyl3))
+#' splitter_d(mtcars, .(cyl3, vs))
+#' splitter_d(mtcars, .(cyl3, vs), drop = FALSE)
 splitter_d &lt;- function(data, .variables = NULL, drop = TRUE) {
   splits &lt;- eval.quoted(.variables, data, parent.frame())
   
   splitv &lt;- ninteraction(splits, drop = drop)
   split_labels &lt;- split_labels(splits, drop = drop)
 
+  browser()
   index &lt;- tapply(1:nrow(data), splitv, list)
 
   if (!drop) {
@@ -54,12 +57,12 @@ splitter_d &lt;- function(data, .variables = NULL, drop = TRUE) {
   )
 }
 
-# Generate labels for split data frame
-# Create data frame giving labels for split data frame.
-# 
-# @arguments list of variables to split up by
-# @argument whether all possible combinations should be considered, or only those present in the data
-# @keyword internal
+#' Generate labels for split data frame
+#' Create data frame giving labels for split data frame.
+#' 
+#' @param list of variables to split up by
+#' @param whether all possible combinations should be considered, or only those present in the data
+#' @keywords internal
 split_labels &lt;- function(splits, drop) {
   
   if (drop) {</diff>
      <filename>R/split-data-frame.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,11 @@
 
-# Subset splits
-# Subset splits, ensuring that labels keep matching
-# 
-# @keyword internal
+#' Subset splits
+#' Subset splits, ensuring that labels keep matching
+#' 
+#' @keywords internal
+#' @param x split object
+#' @param i index
+#' @param ... unused
 &quot;[.split&quot; &lt;- function(x, i, ...) {
   structure(
     NextMethod(),
@@ -12,10 +15,12 @@
   )
 }
 
-# Convert split list to regular list
-# Strip off label related attributed to make a strip list as regular list
-# 
-# @keyword internal
+#' Convert split list to regular list
+#' Strip off label related attributed to make a strip list as regular list
+#' 
+#' @keywords internal
+#' @param x object to convert to a list
+#' @param ... unused
 as.list.split &lt;- function(x, ...) {
   attr(x, &quot;split_type&quot;) &lt;- NULL
   attr(x, &quot;split_labels&quot;) &lt;- NULL
@@ -23,10 +28,12 @@ as.list.split &lt;- function(x, ...) {
   x
 }
 
-# Print split
-# Don't print labels, so it appears like a regular list
-# 
-# @keyword internal
+#' Print split
+#' Don't print labels, so it appears like a regular list
+#' 
+#' @keywords internal
+#' @param x object to print
+#' @param ... unused
 print.split &lt;- function(x, ...) {
   print(as.list(x))
 }
\ No newline at end of file</diff>
      <filename>R/split.r</filename>
    </modified>
    <modified>
      <diff>@@ -1,28 +1,20 @@
-# Determine if a vector is discrete
-# A discrete vector is a factor or a character vector
-# 
-# @arguments vector to test
-# @keyword internal
-#X is.discrete(1:10)
-#X is.discrete(c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;))
-#X is.discrete(factor(c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;)))
+#' Determine if a vector is discrete
+#' A discrete vector is a factor or a character vector
+#' 
+#' @param x vector to test
+#' @keywords internal
+#' @examples
+#' is.discrete(1:10)
+#' is.discrete(c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;))
+#' is.discrete(factor(c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;)))
 is.discrete &lt;- function(x) is.factor(x) || is.character(x) || is.logical(x)
 
-# Un-rowname
-# Strip rownames from an object
-# 
-# @keyword internal
+#' Un-rowname
+#' Strip rownames from an object
+#' 
+#' @keywords internal
+#' @param x data frame
 unrowname &lt;- function(x) {
   rownames(x) &lt;- NULL
   x
 }
-
-# Reorder character
-# Make it possible to reorder character vectors
-# 
-# Should be removed once this is built into R.
-# 
-# @keyword internal
-reorder.character &lt;- function(x, X, FUN = mean, ...) {
-  reorder(factor(x), X = X, FUN = FUN, ...)
-}
\ No newline at end of file</diff>
      <filename>R/utils.r</filename>
    </modified>
    <modified>
      <diff>@@ -20,19 +20,19 @@ a list of length 0  (\code{list()}).
 
 See \code{vignette(&quot;intro&quot;, &quot;plyr&quot;)} for more details, description and case studies.
 
-@keyword manip
+@keywords manip
 
-@arguments matrix, array or data frame to be processed
-@arguments list to be processed
-@arguments data frame to be processed
+@param matrix, array or data frame to be processed
+@param list to be processed
+@param data frame to be processed
 
-@arguments variables to split data frame by, as quoted variables, a formula or character vector
-@arguments a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
+@param variables to split data frame by, as quoted variables, a formula or character vector
+@param a vector giving the subscripts to split up \code{data} by.  1 splits up by rows, 2 by columns and c(1,2) by rows and columns, and so on for higher dimensions
 
-@arguments function to apply to each piece
-@arguments other arguments passed on to \code{.fun}
-@arguments name of the progress bar to use, see \code{\link{create_progress_bar}}
+@param function to apply to each piece
+@param other arguments passed on to \code{.fun}
+@param name of the progress bar to use, see \code{\link{create_progress_bar}}
 
-@value if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
-@value list of results
-@value a data frame
+@return if results are atomic with same type and dimensionality, a vector, matrix or array; otherwise, a list-array (a list with dimensions)
+@return list of results
+@return a data frame</diff>
      <filename>plyr-doc.txt</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>NAMESPACE</filename>
    </removed>
    <removed>
      <filename>man/a-ply-2j.rd</filename>
    </removed>
    <removed>
      <filename>man/aaply-ym.rd</filename>
    </removed>
    <removed>
      <filename>man/adply-du.rd</filename>
    </removed>
    <removed>
      <filename>man/alply-wh.rd</filename>
    </removed>
    <removed>
      <filename>man/amv-dim-98.rd</filename>
    </removed>
    <removed>
      <filename>man/amv-dimnames-eb.rd</filename>
    </removed>
    <removed>
      <filename>man/as-data-frame-function-e1.rd</filename>
    </removed>
    <removed>
      <filename>man/as-df-d2.rd</filename>
    </removed>
    <removed>
      <filename>man/as-list-split-td.rd</filename>
    </removed>
    <removed>
      <filename>man/as-quoted-3f.rd</filename>
    </removed>
    <removed>
      <filename>man/b.rd</filename>
    </removed>
    <removed>
      <filename>man/colwise-5m.rd</filename>
    </removed>
    <removed>
      <filename>man/compact-79.rd</filename>
    </removed>
    <removed>
      <filename>man/create-progress-bar-4d.rd</filename>
    </removed>
    <removed>
      <filename>man/d-ply-4j.rd</filename>
    </removed>
    <removed>
      <filename>man/daply-7r.rd</filename>
    </removed>
    <removed>
      <filename>man/ddply-5k.rd</filename>
    </removed>
    <removed>
      <filename>man/defaults-jw.rd</filename>
    </removed>
    <removed>
      <filename>man/dims-7t.rd</filename>
    </removed>
    <removed>
      <filename>man/dlply-7t.rd</filename>
    </removed>
    <removed>
      <filename>man/each-4v.rd</filename>
    </removed>
    <removed>
      <filename>man/eval-quoted-ki.rd</filename>
    </removed>
    <removed>
      <filename>man/failwith-sc.rd</filename>
    </removed>
    <removed>
      <filename>man/get--split-0n.rd</filename>
    </removed>
    <removed>
      <filename>man/indexed-array-4w.rd</filename>
    </removed>
    <removed>
      <filename>man/indexed-df-uf.rd</filename>
    </removed>
    <removed>
      <filename>man/is-discrete-93.rd</filename>
    </removed>
    <removed>
      <filename>man/is-formula-9d.rd</filename>
    </removed>
    <removed>
      <filename>man/l-ply-3u.rd</filename>
    </removed>
    <removed>
      <filename>man/laply-10.rd</filename>
    </removed>
    <removed>
      <filename>man/ldply-f5.rd</filename>
    </removed>
    <removed>
      <filename>man/list-to-array-ki.rd</filename>
    </removed>
    <removed>
      <filename>man/list-to-dataframe-zb.rd</filename>
    </removed>
    <removed>
      <filename>man/list-to-vector-27.rd</filename>
    </removed>
    <removed>
      <filename>man/llply-12.rd</filename>
    </removed>
    <removed>
      <filename>man/m-ply-5z.rd</filename>
    </removed>
    <removed>
      <filename>man/maply-h2.rd</filename>
    </removed>
    <removed>
      <filename>man/mdply-cn.rd</filename>
    </removed>
    <removed>
      <filename>man/mlply-h5.rd</filename>
    </removed>
    <removed>
      <filename>man/names-quoted-g1.rd</filename>
    </removed>
    <removed>
      <filename>man/ninteraction-vw.rd</filename>
    </removed>
    <removed>
      <filename>man/nunique-ob.rd</filename>
    </removed>
    <removed>
      <filename>man/print-quoted-15.rd</filename>
    </removed>
    <removed>
      <filename>man/print-split-fc.rd</filename>
    </removed>
    <removed>
      <filename>man/progress-none-u0.rd</filename>
    </removed>
    <removed>
      <filename>man/progress-text-29.rd</filename>
    </removed>
    <removed>
      <filename>man/progress-tk-qf.rd</filename>
    </removed>
    <removed>
      <filename>man/progress-win-b6.rd</filename>
    </removed>
    <removed>
      <filename>man/r-ply-qd.rd</filename>
    </removed>
    <removed>
      <filename>man/raply-uc.rd</filename>
    </removed>
    <removed>
      <filename>man/rbind-fill-di.rd</filename>
    </removed>
    <removed>
      <filename>man/rdply-1o.rd</filename>
    </removed>
    <removed>
      <filename>man/reduce-cf.rd</filename>
    </removed>
    <removed>
      <filename>man/reorder-character-4u.rd</filename>
    </removed>
    <removed>
      <filename>man/rlply-s7.rd</filename>
    </removed>
    <removed>
      <filename>man/splat-n6.rd</filename>
    </removed>
    <removed>
      <filename>man/split-labels-0o.rd</filename>
    </removed>
    <removed>
      <filename>man/splitter-a-cs.rd</filename>
    </removed>
    <removed>
      <filename>man/splitter-d-cs.rd</filename>
    </removed>
    <removed>
      <filename>man/summarise-n4.rd</filename>
    </removed>
    <removed>
      <filename>man/try-default-rw.rd</filename>
    </removed>
    <removed>
      <filename>man/tryapply-sa.rd</filename>
    </removed>
    <removed>
      <filename>man/unrowname-ef.rd</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>2580967577babd05be1f91a4337960d45d8ea920</id>
    </parent>
  </parents>
  <author>
    <name>hadley</name>
    <email>h.wickham@gmail.com</email>
  </author>
  <url>http://github.com/hadley/plyr/commit/13c1ea51ee50bf46693c333287296806215e4c8e</url>
  <id>13c1ea51ee50bf46693c333287296806215e4c8e</id>
  <committed-date>2009-09-14T06:02:18-07:00</committed-date>
  <authored-date>2009-09-14T05:45:15-07:00</authored-date>
  <message>Convert documentation to roxygen.</message>
  <tree>536ed62cee9b0233607f0ef434745165fa2ac263</tree>
  <committer>
    <name>hadley</name>
    <email>h.wickham@gmail.com</email>
  </committer>
</commit>
