nested_in {edibble}R Documentation

Specify the nesting structure for units

Description

Specify the nesting structure for units

Usage

nested_in(
  x,
  ...,
  prefix = "",
  suffix = "",
  leading0 = FALSE,
  sep = edibble_labels_opt("sep"),
  attrs = NULL
)

Arguments

x

The name of the parent unit to nest under.

...

a single number OR a sequence of two-sided formula where the left-hand side corresponds to the name of the level (or the level number) of x and the right-hand side is an integer specifying the number of levels nested under the corresponding levels.

prefix

The prefix of the label.

suffix

The suffix of the label.

leading0

Whether there should be a leading 0 if labels are made.

sep

A separator added between prefix and the number if prefix is empty.

attrs

A named vector where names and values correspond to attribute names and values of the variable, or a data frame.

Value

A nested level.

See Also

See set_units() for examples of how to use this.

Examples

design("Split-Plot Design | Split-Unit Design") %>%
  set_units(mainplot = 60,
            subplot = nested_in(mainplot, 10))

[Package edibble version 0.1.2 Index]