as.data.frame-cellComparison-method: Translate cellComparison objects to data frame

Description Usage Arguments Value See Also Examples

Description

Versions of a data set can be cellwise compared using cells. The result is a cellComparison object, which can usefully be translated into a data frame.

Usage

1
2
## S4 method for signature 'cellComparison'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Arguments

x

Object to coerce

row.names

ignored

optional

ignored

...

arguments passed to other methods

Value

A data frame with the following columns.

See Also

Other comparing: as.data.frame,validatorComparison-method, barplot,cellComparison-method, barplot,validatorComparison-method, cells(), compare(), match_cells(), plot,cellComparison-method, plot,validatorComparison-method

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
data(retailers)

# start with raw data
step0 <- retailers

# impute turnovers
step1 <- step0
step1$turnover[is.na(step1$turnover)] <- mean(step1$turnover,na.rm=TRUE)

# flip sign of negative revenues
step2 <- step1
step2$other.rev <- abs(step2$other.rev)
  

# create an overview of differences, comparing to the previous step
cells(raw = step0, imputed = step1, flipped = step2, compare="sequential")

# create an overview of differences compared to raw data
out <- cells(raw = step0, imputed = step1, flipped = step2)
out

# Graphical overview of the changes
plot(out)
barplot(out)

# transform data to data.frame (easy for use with ggplot)
as.data.frame(out)

validate documentation built on Oct. 7, 2021, 9:19 a.m.