Learn R Programming

inti (version 0.7.2)

plot_split_rcbd_design: Plot Splitplot-RCBD fieldbook design

Description

Plot fieldbook sketches for Splitplot-RCBD experimental designs generated by design_split_rcbd().

Usage

plot_split_rcbd_design(
  data,
  factor = NA,
  fill = "plots",
  xlab = NULL,
  ylab = NULL,
  glab = NULL,
  text_size = NULL,
  wrap_width = NULL,
  font_family = "Open Sans",
  font_face = "plain"
)

Value

A ggplot object.

Arguments

data

Fieldbook data frame from design_split_rcbd().

factor

Character scalar. Column used to color experimental units. If missing, "wp_sp" is used when available; otherwise, "ntreat" is used.

fill

Character vector. Column or columns used as labels inside each experimental unit. Default is "plots".

xlab

Character scalar. Optional x axis title.

ylab

Character scalar. Optional y axis title.

glab

Character scalar. Optional legend title.

text_size

Optional positive numeric scalar indicating the plot-label font size in typographic points (pt). If NULL or NA, the function calculates an automatic size: 10 pt for one label column, 8 pt for two columns and 7 pt for three or more columns.

wrap_width

Optional positive integer indicating the approximate maximum number of characters per line. If NULL or NA, labels are not wrapped. Underscores are displayed as spaces only in the sketch.

font_family

Font family used in the sketch. Defaults to "Open Sans". If it or the optional systemfonts package is unavailable, the function silently uses "sans".

font_face

Font face used in the sketch. Defaults to "plain", equivalent to regular/normal text.

Details

Each block is displayed in a separate panel. Within each block:

  • cols identifies the whole-plot position on the x axis.

  • The ranked rows values identify subplot positions on the y axis.

  • A black external border identifies each whole plot.

Label wrapping changes only the displayed text. It does not modify plots, ntreat, treatment factors, QR codes or any other fieldbook value.

text_size is expressed in points, like common word processors. Internally it is converted to the size unit expected by ggplot2::geom_text().

The visible design name is Splitplot-RCBD, while the stable internal identifier remains "split-rcbd".

Examples

Run this code
if (FALSE) {

plot_split_rcbd_design(
  data = fieldbook,
  factor = "wp_sp",
  fill = c("plots", "ntreat"),
  text_size = 9,
  wrap_width = 14,
  font_family = "Open Sans",
  font_face = "plain"
)

}

Run the code above in your browser using DataLab