all.equal.tbl_df

0th

Percentile

Provide a useful implementation of all.equal for data.frames.

Provide a useful implementation of all.equal for data.frames.

Usage
# S3 method for tbl_df
all.equal(target, current, ignore_col_order = TRUE,
  ignore_row_order = TRUE, convert = FALSE, ...)

# S3 method for tbl_dt all.equal(target, current, ignore_col_order = TRUE, ignore_row_order = TRUE, convert = FALSE, ...)

Arguments
target,current
two data frames to compare
ignore_col_order
should order of columns be ignored?
ignore_row_order
should order of rows be ignored?
convert
Should similar classes be converted? Currently this will convert factor to character and integer to double.
...
Ignored. Needed for compatibility with the generic.
Value

TRUE if equal, otherwise a character vector describing the first reason why they're not equal. Use isTRUE if using the result in an if expression.

Aliases
  • all.equal.tbl_df
  • all.equal.tbl_dt
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)
Documentation reproduced from package dplyr, version 0.3, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.