tableplot_comparison: Compare two tableplots (experimental)

Description Usage Arguments Value Examples

Description

Two tableplots can be compared by substracting two tabplot-objects. The result is a tabplot_compare-object object in which absolute and relative differences of mean values are stored, as well as a comparison of frequency tables for categorical variables. This object can be plotted with plot.

Usage

1
2
## S3 method for class 'tabplot'
 tp1 - tp2

Arguments

tp1

the first tabplot-object

tp2

the second tabplot-object

Value

a tabplot_compare-object that contains information about the comparison tp1-tp2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# load diamonds dataset from ggplot2
require(ggplot2)
data(diamonds)

# calculate normalized prices to be used as sample probabilities
price.norm <- with(diamonds, price / max(diamonds$price))

# draw samples
exp.diamonds <- diamonds[sample(1:nrow(diamonds), size=10000, prob=price.norm, replace=TRUE),]
chp.diamonds <- diamonds[sample(1:nrow(diamonds), size=10000, prob=1-price.norm, replace=TRUE),]

tp1 <- tableplot(exp.diamonds)
tp2 <- tableplot(chp.diamonds)

plot(tp2 - tp1)

mtennekes/tabplot documentation built on March 8, 2021, 6:11 p.m.