unbin: Unbin Data Frame

Description Usage Arguments Value Examples

View source: R/unbin.R

Description

Unbin a data frame, i.e. replicate rows according to frequencies given in a vector. The function is intended to reconstruct raw data from data binned to classes.

Usage

1
unbin(x, freq)

Arguments

x

a vector or data frame with binned data

freq

vector of frequencies

Value

Vector or data frame with the same stucture as x with replicated elements or rows.

Examples

1
2
3
4
5
6
7
8
9
x <- data.frame(a=1:3, b=c("a", "b", "c"), freq=c(2, 5, 3))
unbin(x, x$freq)

zd <- 6:35

counts <- c(155, 0, 8, 12, 17, 35, 37, 66, 42, 39, 13, 4, 4, 8, 19, 36,
            80, 205, 188, 219, 170, 104, 32, 13, 12, 0, 3, 0, 0, 0)

observations <- unbin(zd, counts)

tpetzoldt/antibioticR documentation built on Sept. 25, 2021, 1:17 p.m.