gexp is an R package for planning, simulating, and visualizing structured experiments.
- Experimental designs: completely randomized (CRD), randomized complete block (RCBD), and Latin square (LSD).
- Experiment types: simple (
SIMPLE), factorial (FE), and split-plot (SPE). - Controlled simulation of treatment effects, errors, and multivariate responses with optional covariance structure.
- Layout planning from images of the experimental area (
jpeg/pnginput). - S3 workflow with
summary(),print(), andplot()methods for each design class.
Install from CRAN:
install.packages("gexp")Install the development version from GitHub:
# install.packages("remotes")
remotes::install_github("ivanalaman/gexp")library(gexp)
# SIMPLE + RCBD: fe (effects) before fl (labels) for each factor;
# blke (block effects) before blkl (block labels)
rcbd <- gexp(mu = 10,
err = matrix(0, nrow = 12, ncol = 1),
r = 2,
fe = list(trt = c(1, -2)),
fl = list(trt = paste0("t", 1:2)),
blke = c(0, 1, 2),
blkl = list(blk = paste0("b", 1:3)),
type = "SIMPLE",
design = "RCBD")
print(rcbd)
summary(rcbd)
plot(rcbd)Same example as demo("simple-rcbd"). For more detail, see vignette("gexp-overview", package = "gexp").
After attaching the package, list and run interactive demos (one per experiment type and design):
library(gexp)
demo() # menu of all demos
demo("simple-crd") # SIMPLE + CRD
demo("fe-rcbd") # factorial + RCBD
demo("spe-crd") # split-plot + CRDAvailable topics: simple-crd, simple-rcbd, simple-lsd, fe-crd, fe-rcbd, fe-lsd, spe-crd, spe-rcbd, spe-lsd.
/R: Core computational, planning, and plotting functions./man: Documentation (.Rdfiles)./demo: Runnable examples for each type and design./inst: Extra package materials (e.g. bibliography)./vignettes: Vignettes and tutorials.
Contributions are welcome. Open an Issue or submit a Pull Request on github.com/ivanalaman/gexp with:
- Bug fixes and performance improvements.
- Documentation and usability improvements.
- New ideas for experiment generation and visualization workflows.
- Modernize package metadata and repository layout to match current maintenance standards.
- Expand test coverage for design generation and plotting behavior.
- Expand demos and vignettes with additional real-world examples.
- Improve CI signals and package quality checks.
Developed by:
Faria, J. C.; Allaman, I. B.
Universidade Estadual de Santa Cruz - UESC
Departamento de Ciências Exatas - DCEX
Ilhéus - Bahia - Brasil