disk_usage: Disk Usage of Specific Object

Description Usage Arguments Value Examples

View source: R/du.R

Description

Disk Usage of Specific Object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
disk_usage(object, full_data)

## Default S3 method:
disk_usage(object, full_data)

## S3 method for class 'gam'
disk_usage(object, full_data)

## S3 method for class 'ggplot'
disk_usage(object = ggplot2::last_plot(), full_data)

## S3 method for class 'glm'
disk_usage(object, full_data)

## S3 method for class 'lm'
disk_usage(object, full_data)

Arguments

object

Different types, including glm, ggplot.

full_data

Full data that the data passed into object was derived from

Value

A binary data matrix.

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
library(mgcv)
dat <- gamSim(1, n = 400, dist = "normal", scale = 2)
b <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat)
disk_usage(b, dat)


dat <- gamSim(1, n = 25000, dist = "normal", scale = 20)
bs <- "cr"
k <- 12
b <- bam(y ~ s(x0, bs = bs) + s(x1, bs = bs) + s(x2, bs = bs, k = k) +
           s(x3, bs = bs),
         data = dat[sample(nrow(dat), size = 10000),])
disk_usage(b, dat)
if (requireNamespace("MASS", quietly = TRUE)) {
  utils::data(anorexia, package = "MASS")

  anorex.1 <- glm(Postwt ~ Prewt + Treat + offset(Prewt),
                  family = gaussian, data = anorexia[ anorexia$Prewt > 70.25,])
  disk_usage(anorex.1, full_data = anorexia)
  disk_usage(list(data = anorex.1$data), full_data = anorexia)
}
if (requireNamespace("MASS", quietly = TRUE)) {
  utils::data(anorexia, package = "MASS")

  anorex.1 <- lm(Postwt ~ Prewt + offset(Prewt), data = anorexia)
  disk_usage(anorex.1, full_data = anorexia)
  disk_usage(list(model = anorex.1$model), full_data = anorexia)

}

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