Cell counts and differences for a series of datasets

Share:

Description

Cell counts and differences for a series of datasets

Usage

1
cells(..., .list = NULL, compare = c("to_first", "sequential"))

Arguments

...

A (named) sequence of R objects carrying data (e.g. data.frames)

.list

A list of R objects carrying data; will be concatenated with objects in ...

compare

How to compare the datasets.

Value

An object of class cellComparison, which is really an array with a few attributes. It counts the total number of cells, the number of missings, the number of altered values and changes therein as compared to the reference defined in how.

Details

This function assumes that the datasets have the same dimensions and that both rows and columns are ordered similarly.

See Also

  • compare

  • match_cells

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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 compared to raw data
cells(raw = step0, imputed = step1, flipped = step2)

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.