Learn R Programming


output: github_document

Installation of the package

Use the following command to install the package from CRAN:

install.packages("agricolaeplotr")

Usage of the Package

This section demonstrates the usage of the package and its underlying functions. Factorial experiments are ubiquitous in all science and technology fields, and as an example, a factorial AB-design will be used. While some parameters are specifically relevant to agriculture, most others are beneficial for every user.

Load the Package

Use the following command to load the package after installation. The two packages below 'agricolaeplotr' are only needed for the examples.


library("agricolaeplotr")

library("ggplot2")

library("agricolae")

Example: Factorial AB Design with Complete Randomization

To create a design, we first utilize the agricolae package. All examples provided are directly sourced from agricolae.

After creating the object, everything is set to plot a basic graph. It is assumed that the height and width of each plot are both set to 1. In agricultural designs, it is recommended to input the measures from a plot to estimate the dimensions needed for implementing such an experiment in the field. Knowing the required dimensions in meters or other units is crucial for machinery and experiment management.

Complete randomized designs lack a factor like blocks, requiring the user to input suitable numbers for columns and rows. The product of these numbers must be greater than the size of the experiment, allowing the program to place all plots.

The following figure illustrates the output of a factorial design with two factors. The first factor has three levels, and the second one has two. The output is a standard ggplot2 design. This implies that users can apply all operations that ggplot2 and other packages using ggplot2 functions can offer. There are no layer restrictions or overly specialized layers preventing other transformations. Additionally, users may leverage 'plotly' to create interactive visualizations of the designs. This is particularly useful for field demonstrations involving various project stakeholders such as scientists, farmers, and funding agencies.

library(agricolae) # origin of the needed design object
trt <- c(3, 2) # factorial 3x2
outdesign <- design.ab(trt, r = 3, serie = 2, design = 'crd')

head(outdesign$book, 10)

plot_design.factorial_crd(outdesign, ncols = 6, nrows = 3, width = 1, height = 1)

![factorial design](C:\Users\Jens Harbers\Documents\RPlot.jpeg)

Planned Features for Future Versions

  • Introduce a Shiny interface for interactive experiment layout.
  • Incorporate additional custom field experiment tools.
  • Enable the export of experiments to the ISOBUS standard.
  • Implement the export of designs to PostgreSQL.

Copy Link

Version

Install

install.packages('agricolaeplotr')

Monthly Downloads

435

Version

0.6.1

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Jens Harbers

Last Published

January 30th, 2025

Functions in agricolaeplotr (0.6.1)

plot_split_lsd

Plot Split Plot Design lsd
plot_youden

Plot Youden Design
plot_strip

Plot Strip Design
plot_graeco

Plot Graeco Latin Square Design
test_input_ncols

checks matrix column input
test_input_extend

Test if input for width and height is numeric
test_input_nrows

checks matrix rows input
test_input_reverse

Test if input is a logical
to_table

to_table
theme_pres

ggplot2 theme for outdoor presentation
test_names_design

Test of experimental design
theme_gi

theme_gi
test_string

Test if input is a string
plot_split_rcbd

Plot Split Plot Designs with rcbd
sample_locations

Sample Locations
protective_layers

Create Protective Layers for Design of Experiments (DOEs)
theme_poster

ggplot2 theme for poster presentation
test_name_in_column

Test if input column names
summary

summary of a field Layout
test_input_shift

Test if input for shift parameter is numeric
serpentine

Serpentine
plot_design.factorial_crd

Plot Factorial Complete Randomized Designs (crd)
make_polygons

make_polygons
full_control_positions

full_control_positions
DOE_obj

Measures of a Field Design
plot_cyclic

Plot Cyclic Design
plot_design.factorial_lsd

Plot Factorial Latin Square Designs (lsd)
citations

Citation
plot_alpha

Plot Alpha design Experiments
plot_dau

Plot Design of Augmented Blocks (dau)
plot_bib

Plot Randomized Balanced Incomplete Block Designs
plot_latin_square

Plot Latin Square Design
plot_rcbd

Plot randomized complete block designs
plot_fieldhub

Plot FielDHub Design
plot_lattice_simple

Plot Simple Lattice Design
plot_split_crd

Plot Split Plot Designs (crd)
plot_lattice_triple

Plot Triple Lattice Design
plot_longest_diagonal

Plot the longest diagonal of a field
plot_design.factorial_rcbd

Plot Factorial Designs with rcbd Design
plot_design_crd

Plot Complete Randomized Design