add_border: Make an enhanced field layout plot with border rows.

add_borderR Documentation

Make an enhanced field layout plot with border rows.

Description

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.

Usage

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"
)

Arguments

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.

Value

A 'ggplot2' graphical object of field layout with border rows around the entire perimeter.

Note

This function works best with input field books generated with the 'FielDHub' package

Examples


# 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)




qrlabelr documentation built on May 29, 2024, 10:16 a.m.