du: General Data Usage

Description Usage Arguments Value Examples

View source: R/du.R

Description

General Data Usage

Usage

1
du(..., full_data)

Arguments

...

a set of objects to obtain data usage.

full_data

Full data that the data passed into object was derived from

Value

A data matrix of percentages.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## an example with offsets from Venables & Ripley (2002, p.189)
if (requireNamespace("MASS", quietly = TRUE)) {
utils::data(anorexia, package = "MASS")

sub_anor = anorexia[anorexia$Prewt > 73,]

anorex.1 <- glm(Postwt ~ Prewt + Treat + offset(Prewt),
                family = gaussian, data = anorexia[anorexia$Prewt > 70.25,])
anorex.2 <- glm(Postwt ~ Prewt + offset(Prewt),
                family = gaussian, data = anorexia)
du(anorex.1, anorex.2, sub_anor, full_data = anorexia)
library(ggplot2)
library(dplyr)
g = anorexia %>%
   filter(Prewt > 75 & Postwt < 100) %>%
   ggplot(aes(x = Prewt, y = Postwt, colour = Treat))
g2 = anorexia %>%
   ggplot(aes(x = Prewt, y = Postwt)) +
   geom_point() +
   geom_line(data = sub_anor, aes(size = Treat))
du(g, g2,  full_data = anorexia)
du(g, g2, anorex.1, anorex.2, list(data = sub_anor), full_data = anorexia)
}

muschellij2/du documentation built on March 10, 2021, 12:43 a.m.