https://github.com/hadley/dplyr
Raw File
Tip revision: 1f57c48a765ad60837ffed1fe0572c40f4b7a3de authored by hadley on 09 January 2015, 12:35:47 UTC
Merge branch 'master' of github.com:hadley/dplyr
Tip revision: 1f57c48
all.equal.tbl_df.Rd
% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/all-equal.r
\name{all.equal.tbl_df}
\alias{all.equal.tbl_df}
\alias{all.equal.tbl_dt}
\title{Provide a useful implementation of all.equal for data.frames.}
\usage{
\method{all.equal}{tbl_df}(target, current, ignore_col_order = TRUE,
  ignore_row_order = TRUE, convert = FALSE, ...)

\method{all.equal}{tbl_dt}(target, current, ignore_col_order = TRUE,
  ignore_row_order = TRUE, convert = FALSE, ...)
}
\arguments{
\item{target,current}{two data frames to compare}

\item{ignore_col_order}{should order of columns be ignored?}

\item{ignore_row_order}{should order of rows be ignored?}

\item{convert}{Should similar classes be converted? Currently this will
convert factor to character and integer to double.}

\item{...}{Ignored. Needed for compatibility with the generic.}
}
\value{
\code{TRUE} if equal, otherwise a character vector describing
  the first reason why they're not equal. Use \code{\link{isTRUE}} if
  using the result in an \code{if} expression.
}
\description{
Provide a useful implementation of all.equal for data.frames.
}
\examples{
scramble <- function(x) x[sample(nrow(x)), sample(ncol(x))]

# By default, ordering of rows and columns ignored
mtcars_df <- tbl_df(mtcars)
all.equal(mtcars_df, scramble(mtcars_df))

# But those can be overriden if desired
all.equal(mtcars_df, scramble(mtcars_df), ignore_col_order = FALSE)
all.equal(mtcars_df, scramble(mtcars_df), ignore_row_order = FALSE)
}

back to top