testGranularity: test granularity of attributes in data.frame

Description Usage Arguments Value Note Author(s) References Examples

View source: R/describe.R

Description

Compare granularity of whole data.frame and of provided attributes

Usage

1
testGranularity(d.data, var, verbose = NULL, ...)

Arguments

d.data,

data.frame

var,

vector of attributes in d.data

verbose,

add additional output

...

arguments passed to further functions

Value

output describing the granularity

Note

under continuous developement

Author(s)

Roland Rapold

References

none

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
28
29
30
31
32
33
34
35
36
37
38
39
cat("\nBeispieldaten\n")
d.data <- data.frame(a = 1:20,
                     b = rep(1:10, 2),
                     c = letters[1:20],
                     d = rep(letters[1:10], 2))

cat("\nBetrachtung eines Attributes\n")
var <- c("a")
testGranularity(d.data = d.data, var = var)
testGranularity(d.data = d.data, var = var, verbose = FALSE)

cat("\nBetrachtung eines Attributes\n")
var <- c("b")
testGranularity(d.data = d.data, var = var)

cat("\nBetrachtung von zwei Attributen\n")
var <- c("a", "b")
testGranularity(d.data = d.data, var = var)

cat("\nBetrachtung von drei Attributen\n")
var <- c("a", "b", "c", "d")
testGranularity(d.data = d.data, var = var)

cat("\nBetrachtung mit einem Wert NA\n")
d.data[16, 3] <- NA
var <- c("a", "b", "c", "d")
testGranularity(d.data = d.data, var = var)

cat("\nBeispiel ChickWeight mit einem Attribut\n")
var <- c("Chick")
testGranularity(d.data = ChickWeight, var = var)

cat("\nBeispiel ChickWeight mit zwei Attributen\n")
var <- c("Chick", "Diet")
testGranularity(d.data = ChickWeight, var = var)

cat("\nBeispiel ChickWeight mit drei Attributen\n")
var <- c("Chick", "Diet", "Time")
testGranularity(d.data = ChickWeight, var = var)

rrMisc documentation built on June 25, 2021, 3 a.m.