ff
  1   ˆl–Ðz¾”d
i?u8 \¸Ó× Ú˜´o�þZYÇðDG‚èDçÐ4ÏÀÌ      986
     ˆË�þC,¯,Ù#z1´É\Œ þÐƒx/5ÏÀÌ ø    ## ----include = FALSE--------------------------------------------------------------------------------------------------
knitr::opts_chunk$set(eval = TRUE, message = FALSE, results = 'asis', comment='')
options(width = 120)

## ----results = 'asis'-------------------------------------------------------------------------------------------------
library(arsenal)

## ---------------------------------------------------------------------------------------------------------------------
df1 <- data.frame(id = paste0("person", 1:3),
                  a = c("a", "b", "c"),
                  b = c(1, 3, 4),
                  c = c("f", "e", "d"),
                  row.names = paste0("rn", 1:3),
                  stringsAsFactors = FALSE)
df2 <- data.frame(id = paste0("person", 3:1),
                  a = c("c", "b", "a"),
                  b = c(1, 3, 4),
                  d = paste0("rn", 1:3),
                  row.names = paste0("rn", c(1,3,2)),
                  stringsAsFactors = FALSE)

## ----results='markup'-------------------------------------------------------------------------------------------------
comparedf(df1, df2)

## ---------------------------------------------------------------------------------------------------------------------
summary(comparedf(df1, df2))

## ---------------------------------------------------------------------------------------------------------------------
summary(comparedf(df1, df2, by = "id"))

## ---------------------------------------------------------------------------------------------------------------------
data(mockstudy)
mockstudy2 <- muck_up_mockstudy()

## ---------------------------------------------------------------------------------------------------------------------
summary(comparedf(mockstudy, mockstudy2, by = "case"))

## ----eval = FALSE-----------------------------------------------------------------------------------------------------
#  summary(comparedf(mockstudy, mockstudy2, by = "case", control = comparedf.control(tol.vars = "case")))

## ---------------------------------------------------------------------------------------------------------------------
summary(comparedf(mockstudy, mockstudy2, by = "case", tol.vars = "case"))

## ---------------------------------------------------------------------------------------------------------------------
summary(comparedf(mockstudy, mockstudy2, by = "case",
                tol.vars = c("._ ", "case") # dots=underscores=spaces, ignore case
))

## ---------------------------------------------------------------------------------------------------------------------
summary(comparedf(mockstudy, mockstudy2, by = "case",
                tol.vars = c(arm = "Arm", fu.stat = "fu stat", fu.time = "fu_time")
))

## ---------------------------------------------------------------------------------------------------------------------
summary(comparedf(mockstudy, mockstudy2, by = "case",
                tol.vars = c("._ ", "case"), # dots=underscores=spaces, ignore case
                int.as.num = TRUE            # compare integers and numerics
))

## ---------------------------------------------------------------------------------------------------------------------
summary(comparedf(mockstudy, mockstudy2, by = "case",
                tol.vars = c("._ ", "case"), # dots=underscores=spaces, ignore case
                int.as.num = TRUE,           # compare integers and numerics
                tol.num.val = 10             # allow absolute differences <= 10
))

## ---------------------------------------------------------------------------------------------------------------------
summary(comparedf(mockstudy, mockstudy2, by = "case",
                tol.vars = c("._ ", "case"), # dots=underscores=spaces, ignore case
                int.as.num = TRUE,           # compare integers and numerics
                tol.num.val = 10,            # allow absolute differences <= 10
                tol.factor = "labels"        #