View source: R/plot_standard_design.R
| plot_standard_design | R Documentation |
Plot standard fieldbook sketches for regular experimental designs generated in Tarpuy, including completely randomized designs (CRD/DCA) and randomized complete block designs (RCBD/DBCA).
plot_standard_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"
)
data |
A fieldbook data frame. It must contain at least |
factor |
Character scalar. Name of the column used to color the
experimental units. If missing, |
fill |
Character vector. Names of one or more columns used as labels
inside each experimental unit. When |
xlab |
Character scalar. Title for the x axis. If |
ylab |
Character scalar. Title for the y axis. If |
glab |
Character scalar. Legend title. If |
text_size |
Optional positive numeric scalar indicating the plot-label
font size in typographic points ( |
wrap_width |
Optional positive integer indicating the approximate
maximum number of characters per line. If |
font_family |
Character scalar. Font family used by the sketch.
Defaults to |
font_face |
Character scalar. Font face used in labels, axes and
legends. Defaults to |
The function does not calculate or rearrange an experimental design. It uses
the existing rows and cols coordinates from the fieldbook, so the
physical layout and the zigzag order generated by Tarpuy are preserved.
All standard designs are plotted with cols on the x axis and rows on
the y axis. A DBCA/RCBD is therefore displayed according to its actual
physical coordinates rather than replacing the row coordinate with the
block number. When rows and blocks have a strict one-to-one relationship,
only the visible y-axis title changes to "Blocks". The block can still be
selected as the color factor.
Automatic wrapping affects only the sketch. It does not change entry,
ntreat, QR codes, factor levels or any other fieldbook value.
A ggplot object.
## Not run:
plot_standard_design(
data = fieldbook,
factor = "geno",
fill = c("plots", "entry"),
text_size = 9,
font_family = "Open Sans",
font_face = "plain"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.