Learn R Programming

faux (version 1.2.1)

sim_joint_dist: Simulate category joint distribution

Description

This function is mainly used internally, such as for simulating missing data patterns, but is available in case anyone finds it useful.

Usage

sim_joint_dist(data, ..., n = 100, empirical = FALSE)

Value

data table

Arguments

data

the existing tbl

...

columns to calculate the joint distribution from, if none are chosen, all columns with 10 or fewer unique values will be chosen

n

the number of total observations to return

empirical

Should the returned data have the exact same distribution of conditions? (versus be sampled from a population with this distribution)

Examples

Run this code
sim_joint_dist(ggplot2::diamonds, cut, color, n = 10)

Run the code above in your browser using DataLab