Learn R Programming

Tplyr (version 1.2.1)

pop_data: Return or set population data bindings

Description

The population data is used to gather information that may not be available from the target dataset. For example, missing treatment groups, population N counts, and proper N counts for denominators will be provided through the population dataset. The population dataset defaults to the target dataset unless otherwise specified using set_pop_data.

Usage

pop_data(table)

pop_data(x) <- value

set_pop_data(table, pop_data)

Value

For tplyr_pop_data the pop_data binding of the

tplyr_table object. For tplyr_pop_data<- nothing is returned, the pop_data binding is set silently. For set_tplyr_pop_data the modified object.

Arguments

table

A tplyr_table object

x

A tplyr_table object

value

A data.frame with population level information

pop_data

A data.frame with population level information

Examples

Run this code
tab <- tplyr_table(iris, Species)

pop_data(tab) <- mtcars

tab <- tplyr_table(iris, Species) %>%
  set_pop_data(mtcars)

Run the code above in your browser using DataLab