| Title: | Optimal Plot Size Estimation for Field Experiments |
|---|---|
| Description: | Provides methods for determining optimum plot size and shape in field experiments using Fairfield-Smith's variance law approach. It will evaluate field variability, determine optimum plot size and shape and study fertility trends across the field. |
| Authors: | Y.A. Garde [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-0297-316X>), S.G. Patil [aut], M.S. Shitap [aut] |
| Maintainer: | Y.A. Garde <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-06-03 09:30:52 UTC |
| Source: | https://github.com/cran/optsize |
Compute 3x3 moving averages
compute_moving_avg(mat)compute_moving_avg(mat)
mat |
A numeric matrix (at least 3 rows and 3 columns) |
A numeric matrix of 3x3 moving averages
Fertility Classes heatmap with 3 * 3 moving average values —
ferti_analysis(mat)ferti_analysis(mat)
mat |
A matrix to be converted into a horizontal vector |
Heatmap
This function fits the Fairfield-Smith variance law, computes weighted R^2 on the log-log scale, identifies the optimum plot size and recommended shape, and produces two ggplot2 visualisations (original and log scale).
fit_variance_law(df_mat, plot_curve = TRUE)fit_variance_law(df_mat, plot_curve = TRUE)
df_mat |
numeric matrix of data |
plot_curve |
logical, if TRUE returns ggplot objects |
list with results:
df_shapes: data.frame of plot shapes
V1: variance at 1x1
b_hat: estimated variance law coefficient
R2_log: weighted R^2 on log-log scale
x_opt: optimum plot size (units)
Vx_opt: predicted variance at optimum
best_shape: recommended shape for optimum plot size
plots: list of ggplot objects if plot_curve = TRUE
Generate valid plot sizes and shapes
generate_plot_shapes(df_mat)generate_plot_shapes(df_mat)
df_mat |
numeric matrix of data |
data.frame of possible plot sizes and shapes
Compute T values (sum of block totals) for a given h x w plot
get_Tvals(df_mat, h, w)get_Tvals(df_mat, h, w)
df_mat |
numeric matrix of data |
h |
rows in plot |
w |
cols in plot |
numeric vector of block totals
Creates a row-wise vector from a matrix. For every second row, the elements are reversed.
make_horizontal(mat)make_horizontal(mat)
mat |
A matrix to be converted into a horizontal vector |
A numeric vector
Creates a column-wise vector from a matrix. For every second column, the elements are reversed.
make_vertical(mat)make_vertical(mat)
mat |
A matrix to be converted into a vertical vector |
A numeric vector
Compute population variance for given h x w plot
population_variance(df_mat, h, w)population_variance(df_mat, h, w)
df_mat |
numeric matrix of data |
h |
rows in plot |
w |
cols in plot |
numeric variance
Computes the correlation between consecutive elements of a numeric vector.
serial_corr(vec)serial_corr(vec)
vec |
A numeric vector |
Numeric value of the serial correlation
computes the first-order serial correlation for both directions.
serial_corrl(df_mat)serial_corrl(df_mat)
df_mat |
A numeric matrix |
A named list with two elements:
vertical: first-order serial correlation along vertical snake
horizontal: first-order serial correlation along horizontal snake