Learn R Programming

EpiModel (version 0.25)

expanddf: Expand a Frequency-Weighted Data Frame

Description

This function expands a frequency-weighted data frame by the specified weights.

Usage

expanddf(df, count)

Arguments

df
data frame with one row per combination of variables
count
variable on the data frame with the count variable

Examples

Run this code
df <- expand.grid(a=0:1, b=0:1, c=0:1)
df$count <- rpois(nrow(df), 5)
( df2 <- expanddf(df, df$count) )

Run the code above in your browser using DataLab