Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
16 lines (15 sloc) 0.541 kB
#' Remove splitting variables from a data frame.
#'
#' This is useful when you want to perform some operation to every column
#' in the data frame, except the variables that you have used to split it.
#' These variables will be automatically added back on to the result when
#' combining all results together.
#'
#' @param df data frame produced by \code{d*ply}.
#' @export
#' @examples
#' dlply(mtcars, c("vs", "am"))
#' dlply(mtcars, c("vs", "am"), strip_splits)
strip_splits <- function(df) {
df[setdiff(names(df), attr(df, "vars"))]
}
Jump to Line
Something went wrong with that request. Please try again.