add_border | R Documentation |
A helper function that adds border rows to the entire perimeter of a field laid out in a rectangular or square grid. Each experimental plot must have a coordinate that is specified by row and column numbers in the grid layout.
add_border(
x,
row_id = "ROW",
col_id = "COLUMN",
rep_id = "REP",
trt_id = "TREATMENT",
title = "Field layout",
text_sz = 3,
axis_title_sz = 12,
xlab = "Column",
ylab = "Row",
border_bg = "grey80",
text_col = "grey10"
)
x |
The input data frame of field book that has row and column coordinates of each plot. |
row_id |
The string column identifier for ROW in the input field book. |
col_id |
The string column identifier for COLUMN in the input field book. |
rep_id |
The string column identifier for REP in the input field book. |
trt_id |
The string column identifier for TREATMENT in the input field book. |
title |
The title of the field layout plot. |
text_sz |
The text size to print treatment names on the tiles. |
axis_title_sz |
The text size for axis titles. |
xlab |
A string to label x axis; default is 'Column'. |
ylab |
A string to label y axis; default is 'Row'. |
border_bg |
A string specifying the background color for the border rows. |
text_col |
A string specifying the text color for the border rows. |
A 'ggplot2' graphical object of field layout with border rows around the entire perimeter.
This function works best with input field books generated with the 'FielDHub' package
# Plot a field layout with border rows
library(qrlabelr)
set.seed(123)
add_border(x = data.frame(LOCATION = rep("BAMBEY", 12),
PLOT = c(1001:1012),
ROW = c(rep(1, 6), rep(2, 6)),
COLUMN = c(1:6, 1:6),
REP = rep(1, 12),
TREATMENT = sample(paste0("G-", 1:12))),
text_sz = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.