| Title: | Tools and Statistical Procedures in Plant Science |
|---|---|
| Description: | Part of the 'inkaverse' project, 'inti' provides tools and statistical procedures for plant science and experimental design. It supports researchers in experiment planning and data collection ('tarpuy()'), data analysis and visualization ('yupana()'), and scientific writing ('scihub()'). |
| Authors: | Flavio Lozano-Isla [aut, cre] (ORCID: <https://orcid.org/0000-0002-0714-669X>), Yoel Diaz-Saucedo [aut] (ORCID: <https://orcid.org/0009-0003-9765-136X>), Victor-Hugo Baldera-Chapoñan [aut] (ORCID: <https://orcid.org/0009-0003-4321-7103>), María Belén Kistner [ctb] (ORCID: <https://orcid.org/0000-0002-0947-6414>), QuipoLab [ctb], Inkaverse [cph] |
| Maintainer: | Flavio Lozano-Isla <[email protected]> |
| License: | GPL-3 | file LICENSE |
| Version: | 0.7.5.9000 |
| Built: | 2026-10-02 06:07:32 UTC |
| Source: | https://github.com/flavjack/inti |
Fieldbook generator for augmented experimental designs. Every check occurs once in each block and every test entry occurs once in the complete design.
design_augmented( checks, entries, blocks = NULL, eu_block = NULL, random = TRUE, zigzag = FALSE, dim = NA, serie = 1000, seed = NULL, project = "inkaverse", qrcode = "{project}{plots}{entry}", separate_checks = TRUE )design_augmented( checks, entries, blocks = NULL, eu_block = NULL, random = TRUE, zigzag = FALSE, dim = NA, serie = 1000, seed = NULL, project = "inkaverse", qrcode = "{project}{plots}{entry}", separate_checks = TRUE )
checks |
Vector of check treatments. |
entries |
Vector of new or test entries. |
blocks |
Optional number of blocks. If |
eu_block |
Number of experimental units per block. It must be greater than the number of checks. |
random |
Logical. Randomize test-entry allocation and positions inside each block. |
zigzag |
Logical. Arrange the physical field layout in zigzag order. |
dim |
Optional physical layout dimensions |
serie |
Base number used to generate plot identifiers. |
seed |
Random seed. |
project |
Barcode prefix. |
qrcode |
QR-code column template. The default is
|
separate_checks |
Logical. When enough positions are available, place
checks in non-adjacent positions inside each block. With
|
A list with fieldbook and parameters.
Function to deploy field-book experiment without replications
design_noreps( factors, type = "sorted", zigzag = FALSE, nrows = NA, serie = 1000, seed = NULL, project = "inkaverse", qrcode = "{project}{plots}" )design_noreps( factors, type = "sorted", zigzag = FALSE, nrows = NA, serie = 1000, seed = NULL, project = "inkaverse", qrcode = "{project}{plots}" )
factors |
Lists with names and factor vector |
type |
Randomization in the list |
zigzag |
Experiment layout in zigzag |
nrows |
Experimental design dimension by rows |
serie |
Number to start the plot id |
seed |
Replicability from randomization |
project |
Bar code prefix for data collection |
qrcode |
Concatenate the QR code |
A list with the field-book design and parameters
## Not run: library(inti) factores <- list("geno" = c(1:99)) fb <- design_noreps(factors = factores , type = "sorted" , zigzag = F , nrows = 10 ) dsg <- fb$fieldbook fb %>% tarpuy_plotdesign(fill = "plots") fb$parameters ## End(Not run)## Not run: library(inti) factores <- list("geno" = c(1:99)) fb <- design_noreps(factors = factores , type = "sorted" , zigzag = F , nrows = 10 ) dsg <- fb$fieldbook fb %>% tarpuy_plotdesign(fill = "plots") fb$parameters ## End(Not run)
Function to deploy field-book experiments for completely randomized designs (CRD/DCA) and randomized complete block designs (RCBD/DBCA).
design_repblock( nfactors = 1, factors, type = "crd", rep = 3, zigzag = FALSE, nrows = NA, serie = 1000, seed = NULL, project = "inkaverse", qrcode = "{project}{plots}" )design_repblock( nfactors = 1, factors, type = "crd", rep = 3, zigzag = FALSE, nrows = NA, serie = 1000, seed = NULL, project = "inkaverse", qrcode = "{project}{plots}" )
nfactors |
Number of factors in the experiment |
factors |
Named list with the levels of each factor |
type |
Type of experimental arrangement |
rep |
Number of replications or blocks in the experiment
|
zigzag |
Arrange the physical layout in zigzag order |
nrows |
Number of rows in the physical field layout. When missing, the number of replications or blocks is used. |
serie |
Base number used to generate plot identifiers |
seed |
Seed used for reproducible randomization |
project |
Barcode prefix for data collection
|
qrcode |
Template used to concatenate QR-code fields
|
A list with the field-book design and parameters.
## Not run: library(inti) factores <- list( "geno" = c("A", "B", "C", "D", "D", 1, NA, NULL, "NA"), "salt stress" = c(0, 50, 200, 200, "T0", NA, NULL, "NULL"), "time" = c(30, 60, 90) ) fb <- design_repblock( nfactors = 3, factors = factores, type = "rcbd", rep = 5, zigzag = TRUE, seed = 123, nrows = 5, qrcode = "{project}{plots}" ) dsg <- fb$fieldbook fb %>% tarpuy_plotdesign(fill = "plots") fb$parameters ## End(Not run)## Not run: library(inti) factores <- list( "geno" = c("A", "B", "C", "D", "D", 1, NA, NULL, "NA"), "salt stress" = c(0, 50, 200, 200, "T0", NA, NULL, "NULL"), "time" = c(30, 60, 90) ) fb <- design_repblock( nfactors = 3, factors = factores, type = "rcbd", rep = 5, zigzag = TRUE, seed = 123, nrows = 5, qrcode = "{project}{plots}" ) dsg <- fb$fieldbook fb %>% tarpuy_plotdesign(fill = "plots") fb$parameters ## End(Not run)
Dispatch split-plot experimental designs.
design_split( nfactors = 2, factors, type = "split-rcbd", rep = 3, zigzag = FALSE, nrows = NA, serie = 1000, seed = NULL, project = "inkaverse", qrcode = "{project}{plots}{factors}" )design_split( nfactors = 2, factors, type = "split-rcbd", rep = 3, zigzag = FALSE, nrows = NA, serie = 1000, seed = NULL, project = "inkaverse", qrcode = "{project}{plots}{factors}" )
nfactors |
Number of factors in the experiment. |
factors |
List with factor levels. |
type |
Split-plot design type. |
rep |
Number of replications. |
zigzag |
Field layout in zigzag. |
nrows |
Experimental design dimension by rows. |
serie |
Number to start the plot id. |
seed |
Seed for randomization. |
project |
Barcode prefix. |
qrcode |
String to concatenate the QR code. |
A list with the fieldbook design and parameters.
Generate a split-plot design under a randomized complete block design (RCBD) structure for TARPUY.
design_split_rcbd( nfactors = 2, factors, type = "split-rcbd", rep = 3, zigzag = FALSE, nrows = NA, serie = 1000, seed = NULL, project = "inkaverse", qrcode = "{project}{plots}{factors}" )design_split_rcbd( nfactors = 2, factors, type = "split-rcbd", rep = 3, zigzag = FALSE, nrows = NA, serie = 1000, seed = NULL, project = "inkaverse", qrcode = "{project}{plots}{factors}" )
nfactors |
Number of factors in the experiment. Splitplot-RCBD requires exactly two factors. |
factors |
Named list with the factor levels. The first factor is the whole-plot factor and the second factor is the subplot factor. |
type |
Design type. The canonical value is |
rep |
Number of replications or blocks. |
zigzag |
Logical. If |
nrows |
Number of rows in the complete physical layout. The valid
Splitplot-RCBD geometry is |
serie |
Base number used to generate plot identifiers. For example,
|
seed |
Seed used for reproducible randomization. |
project |
Barcode or QR-code prefix. |
qrcode |
Template used to concatenate QR-code fields. The placeholder
|
The first factor is the whole-plot factor and the second factor is the subplot factor. Whole plots are randomized within each block and subplot levels are randomized independently within every whole plot.
A list with fieldbook and parameters.
## Not run: factors <- list( Soil = c("S1", "S2", "S3", "S4"), Fertilizer = c("N1", "N2", "N3", "N4", "N5", "N6") ) design_split_rcbd( factors = factors, rep = 3, zigzag = TRUE, seed = 123 )$fieldbook ## End(Not run)## Not run: factors <- list( Soil = c("S1", "S2", "S3", "S4"), Fertilizer = c("N1", "N2", "N3", "N4", "N5", "N6") ) design_split_rcbd( factors = factors, rep = 3, zigzag = TRUE, seed = 123 )$fieldbook ## End(Not run)
Include tables footnotes and symbols for kables in pandoc format
footnotes(table, notes = NULL, label = "Note:", notation = "alphabet")footnotes(table, notes = NULL, label = "Note:", notation = "alphabet")
table |
Kable output in pandoc format. |
notes |
Footnotes for the table. |
label |
Label for start the footnote. |
notation |
Notation for the footnotes (default = "alphabet"). See details. |
You should use the pandoc format kable(format = "pipe"). You can add
the footnote symbol using {hypen} in your table. notation could
be use: "alphabet", "number", "symbol", "none".
Table with footnotes for word and html documents
Heritability in plant breeding on a genotype difference basis
H2cal( data, trait, gen.name, rep.n, env.n = 1, year.n = 1, env.name = NULL, year.name = NULL, fixed.model, random.model, summary = FALSE, emmeans = FALSE, weights = NULL, plot_diag = FALSE, outliers.rm = FALSE, trial = NULL )H2cal( data, trait, gen.name, rep.n, env.n = 1, year.n = 1, env.name = NULL, year.name = NULL, fixed.model, random.model, summary = FALSE, emmeans = FALSE, weights = NULL, plot_diag = FALSE, outliers.rm = FALSE, trial = NULL )
data |
Experimental design data frame with the factors and traits. |
trait |
Name of the trait. |
gen.name |
Name of the genotypes. |
rep.n |
Number of replications in the experiment. |
env.n |
Number of environments (default = 1). See details. |
year.n |
Number of years (default = 1). See details. |
env.name |
Name of the environments (default = NULL). See details. |
year.name |
Name of the years (default = NULL). See details. |
fixed.model |
The fixed effects in the model (BLUEs). See examples. |
random.model |
The random effects in the model (BLUPs). See examples. |
summary |
Print summary from random model (default = FALSE). |
emmeans |
Use emmeans for calculate the BLUEs (default = FALSE). |
weights |
an optional vector of ‘prior weights’ to be used in the fitting process (default = NULL). |
plot_diag |
Show diagnostic plots using ggplot2 and cowplot (default = FALSE). |
outliers.rm |
Remove outliers (default = FALSE). See references. |
trial |
Column with the name of the trial in the results (default = NULL). |
The function allows to made the calculation for individual or multi-environmental trials (MET) using fixed and random model.
The variance components based in the random model and the population summary information based in the fixed model (BLUEs).
Heritability under three approaches: Standard (ANOVA), Cullis (BLUPs) and Piepho (BLUEs).
Best Linear Unbiased Estimators (BLUEs), fixed effect.
Best Linear Unbiased Predictors (BLUPs), random effect.
Table with the outliers removed for each model.
For individual experiments is necessary provide the {trait},
{gen.name}, {rep.n}.
For MET experiments you should {env.n} and {env.name} and/or
{year.n} and {year.name} according your experiment.
The BLUEs calculation based in the pairwise comparison could be time
consuming with the increase of the number of the genotypes. You can specify
{emmeans = FALSE} and the calculate of the BLUEs will be faster.
If {emmeans = FALSE} you should change 1 by 0 in the fixed model for
exclude the intersect in the analysis and get all the genotypes BLUEs.
Diagnostic plots are produced with ggplot2 and assembled with cowplot.
If {outliers.rm = FALSE}, fixed and random model diagnostics are
displayed in one combined panel. If {outliers.rm = TRUE}, fixed and
random diagnostics are displayed in separate panels comparing before
and after cleaning.
For more information review the references.
list
Maria Belen Kistner
Flavio Lozano Isla
Bernal Vasquez, Angela Maria, et al. “Outlier Detection Methods for Generalized Lattices: A Case Study on the Transition from ANOVA to REML.” Theoretical and Applied Genetics, vol. 129, no. 4, Apr. 2016.
Buntaran, H., Piepho, H., Schmidt, P., Ryden, J., Halling, M., and Forkman, J. (2020). Cross validation of stagewise mixed model analysis of Swedish variety trials with winter wheat and spring barley. Crop Science, 60(5).
Schmidt, P., J. Hartung, J. Bennewitz, and H.P. Piepho. 2019. Heritability in Plant Breeding on a Genotype Difference Basis. Genetics 212(4).
Schmidt, P., J. Hartung, J. Rath, and H.P. Piepho. 2019. Estimating Broad Sense Heritability with Unbalanced Data from Agricultural Cultivar Trials. Crop Science 59(2).
Tanaka, E., and Hui, F. K. C. (2019). Symbolic Formulae for Linear Mixed Models. In H. Nguyen (Ed.), Statistics and Data Science. Springer.
Zystro, J., Colley, M., and Dawson, J. (2018). Alternative Experimental Designs for Plant Breeding. In Plant Breeding Reviews. John Wiley and Sons, Ltd.
library(inti) md <- met %>% H2cal(trait = "yield", gen.name = "cultivar", rep.n = 2, env.name = "env", env.n = 18, fixed.model = ~ 0 + env + (1 | env:rep:alpha) + cultivar, random.model = ~ 1 + env + (1 | env:rep) + (1 | env:rep:alpha) + (1 | cultivar:env) + (1 | cultivar), summary = TRUE, plot_diag = TRUE, outliers.rm = TRUE, emmeans = FALSE ) md$tabsmr md$blues md$blups md$outlierslibrary(inti) md <- met %>% H2cal(trait = "yield", gen.name = "cultivar", rep.n = 2, env.name = "env", env.n = 18, fixed.model = ~ 0 + env + (1 | env:rep:alpha) + cultivar, random.model = ~ 1 + env + (1 | env:rep) + (1 | env:rep:alpha) + (1 | cultivar:env) + (1 | cultivar), summary = TRUE, plot_diag = TRUE, outliers.rm = TRUE, emmeans = FALSE ) md$tabsmr md$blues md$blups md$outliers
Insert PDF files in markdown documents
include_pdf(file, width = "100%", height = "600")include_pdf(file, width = "100%", height = "600")
file |
file path from pdf file. |
width |
width preview file. |
height |
height preview file. |
html code for markdown
Include tables with title and footnotes for word and html documents
include_table(table, caption = NA, notes = NA, label = NA, notation = "none")include_table(table, caption = NA, notes = NA, label = NA, notation = "none")
table |
Data frame. |
caption |
Table caption (default = NULL). See details. |
notes |
Footnotes for the table (default = NA). See details. |
label |
Label for start the footnote (default = NA). |
notation |
Notation for the symbols and footnotes (default = "none") Others: "alphabet", "number", "symbol". |
Table with caption and footnotes
library(inti) table <- data.frame( x = rep_len(1, 5) , y = rep_len(3, 5) , z = rep_len("c", 5) ) table %>% inti::include_table( caption = "Title caption b) line 0 a) line 1 b) line 2" , notes = "Footnote" , label = "Where:" )library(inti) table <- data.frame( x = rep_len(1, 5) , y = rep_len(3, 5) , z = rep_len("c", 5) ) table %>% inti::include_table( caption = "Title caption b) line 0 a) line 1 b) line 2" , notes = "Footnote" , label = "Where:" )
Function to compare treatment from lm or aov using data frames
mean_comparison( data, response, model_factors, comparison, test_comp = "SNK", sig_level = 0.05 )mean_comparison( data, response, model_factors, comparison, test_comp = "SNK", sig_level = 0.05 )
data |
Fieldbook data. |
response |
Model used for the experimental design. |
model_factors |
Factor in the model. |
comparison |
Significance level for the analysis (default = 0.05). |
test_comp |
Comparison test (default = "SNK"). Others: "TUKEY", "DUNCAN". |
sig_level |
Significance level for the analysis (default = 0.05). |
list
## Not run: library(inti) library(gsheet) url <- paste0("https://docs.google.com/spreadsheets/d/" , "15r7ZwcZZHbEgltlF6gSFvCTFA-CFzVBWwg3mFlRyKPs/" , "edit#gid=172957346") # browseURL(url) fb <- gsheet2tbl(url) mc <- mean_comparison(data = fb , response = "spad_29" , model_factors = "bloque* geno*treat" , comparison = c("geno", "treat") , test_comp = "SNK" ) mc$comparison mc$stat ## End(Not run)## Not run: library(inti) library(gsheet) url <- paste0("https://docs.google.com/spreadsheets/d/" , "15r7ZwcZZHbEgltlF6gSFvCTFA-CFzVBWwg3mFlRyKPs/" , "edit#gid=172957346") # browseURL(url) fb <- gsheet2tbl(url) mc <- mean_comparison(data = fb , response = "spad_29" , model_factors = "bloque* geno*treat" , comparison = c("geno", "treat") , test_comp = "SNK" ) mc$comparison mc$stat ## End(Not run)
The datasets were obtained from official Swedish cultivar tests. Dry matter yield was analyzed. All trials were laid out as alpha-designs with two replicates. Within each replicate, there were five to seven incomplete blocks.
metmet
A data frame with 1069 rows and 8 variables:
Sweden is divided into three different agricultural zones: South, Middle, and North
Locations: 18 location in the Zones
Replications (4): number of replication in the experiment
Incomplete blocks (8) in the alpha-designs
Cultivars (30): genotypes evaluated
Yield in kg/ha
Year (1): 2016
enviroment (18): combination zone + location + year
Transform entire fieldbook according to data a dictionary
metamorphosis(fieldbook, dictionary, from, to, index, colnames)metamorphosis(fieldbook, dictionary, from, to, index, colnames)
fieldbook |
Data frame with the original information. |
dictionary |
Data frame with new names and categories. See details. |
from |
Column of the dictionary with the original names. |
to |
Column of the dictionary with the new names. |
index |
Column of the dictionary with the type and level of the variables. |
colnames |
Character vector with the name of the columns. |
The function require at least three columns.
Original names (from).
New names (to).
Variable type (index).
List with two objects. 1. New data frame. 2. Dictionary.
Plot fieldbook sketches for augmented experimental designs generated by
design_augmented().
plot_augmented_design( data, factor = NA, fill = "plots", xlab = NULL, ylab = NULL, glab = NULL, text_size = NULL, wrap_width = NULL, font_family = "Open Sans", font_face = "plain" )plot_augmented_design( data, factor = NA, fill = "plots", xlab = NULL, ylab = NULL, glab = NULL, text_size = NULL, wrap_width = NULL, font_family = "Open Sans", font_face = "plain" )
data |
Fieldbook data frame from an augmented design. |
factor |
Character scalar. Column used to color experimental units.
If missing, |
fill |
Character vector. Column or columns used as labels inside each
experimental unit. Default is |
xlab |
Character scalar. Optional x axis title. If |
ylab |
Character scalar. Optional y axis title. If |
glab |
Character scalar. Optional legend title. If |
text_size |
Optional positive numeric scalar indicating the plot-label
font size in typographic points ( |
wrap_width |
Optional positive integer indicating the approximate
maximum number of characters per line. If |
font_family |
Character scalar. Font family used in the sketch.
Defaults to |
font_face |
Character scalar. Font face used in labels, axes and
legends. Defaults to |
The function always uses the physical rows and cols coordinates stored in
the fieldbook. Therefore, custom dimensions and zigzag layouts are preserved.
The block column never replaces rows as a plotting coordinate. When each
row represents exactly one block, only the visible y-axis title changes from
"Rows" to "Blocks". The statistical block remains available as a color
factor and, when a block occupies a complete rectangular region, its external
border is highlighted.
Empty experimental units are represented by the level "empty". When
factor = "type", checks, test entries and empty plots receive stable
colors. Other factor columns use the regular TARPUY color palette.
Automatic wrapping and formatting affect only the displayed text. They do
not modify entry, plots, ntreat, QR codes or any other fieldbook value.
A ggplot object.
## Not run: plot_augmented_design( data = fieldbook, factor = "type", fill = c("plots", "entry"), text_size = 9, font_family = "Open Sans", font_face = "plain" ) ## End(Not run)## Not run: plot_augmented_design( data = fieldbook, factor = "type", fill = c("plots", "entry"), text_size = 9, font_family = "Open Sans", font_face = "plain" ) ## End(Not run)
Function to plot the diagnostic of models
plot_diagnostic(data, formula, title = NA)plot_diagnostic(data, formula, title = NA)
data |
Experimental design data frame with the factors and traits. |
formula |
Mixed model formula |
title |
Plot title |
plots
## Not run: library(inti) plot_diagnostic(data = potato , formula = stemdw ~ (1|bloque) + geno*treat) ## End(Not run)## Not run: library(inti) plot_diagnostic(data = potato , formula = stemdw ~ (1|bloque) + geno*treat) ## End(Not run)
Function use the raw data for made a boxplot graphic
plot_raw( data, type = "boxplot", x, y, group = NULL, xlab = NULL, ylab = NULL, glab = NULL, ylimits = NULL, xlimits = NULL, xrotation = NULL, legend = "top", xtext = NULL, gtext = NULL, color = TRUE, linetype = 1, opt = NULL )plot_raw( data, type = "boxplot", x, y, group = NULL, xlab = NULL, ylab = NULL, glab = NULL, ylimits = NULL, xlimits = NULL, xrotation = NULL, legend = "top", xtext = NULL, gtext = NULL, color = TRUE, linetype = 1, opt = NULL )
data |
raw data |
type |
Type of graphic. "boxplot" or "scatterplot" |
x |
Axis x variable |
y |
Axis y variable |
group |
Group variable |
xlab |
Title for the axis x |
ylab |
Title for the axis y |
glab |
Title for the legend |
ylimits |
Limits and break of the y axis c(initial, end, brakes) |
xlimits |
For scatter plot. Limits and break of the x axis c(initial, end, brakes) |
xrotation |
Rotation in x axis c(angle, h, v) |
legend |
the position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector) |
xtext |
Text labels in x axis using a vector |
gtext |
Text labels in groups using a vector |
color |
Colored figure (TRUE), black & white (FALSE) or color vector |
linetype |
Line type for regression. Default = 0 |
opt |
Add new layers to the plot |
You could add additional layer to the plot using "+" with ggplot2 options
plot
## Not run: library(inti) fb <- potato fb %>% plot_raw(type = "box" , x = "geno" , y = "twue" #, group = "treat" , ylab = NULL , xlab = NULL , glab = "" ) fb %>% plot_raw(type = "sca" , x = "hi" , y = "twue" , group = "geno" ) ## End(Not run)## Not run: library(inti) fb <- potato fb %>% plot_raw(type = "box" , x = "geno" , y = "twue" #, group = "treat" , ylab = NULL , xlab = NULL , glab = "" ) fb %>% plot_raw(type = "sca" , x = "hi" , y = "twue" , group = "geno" ) ## End(Not run)
Graph summary data into bar o line plot
plot_smr( data, type = NULL, x = NULL, y = NULL, group = NULL, xlab = NULL, ylab = NULL, glab = NULL, ylimits = NULL, xrotation = c(0, 0.5, 0.5), xtext = NULL, gtext = NULL, legend = "top", sig = NULL, sigsize = 3, error = NULL, color = TRUE, opt = NULL )plot_smr( data, type = NULL, x = NULL, y = NULL, group = NULL, xlab = NULL, ylab = NULL, glab = NULL, ylimits = NULL, xrotation = c(0, 0.5, 0.5), xtext = NULL, gtext = NULL, legend = "top", sig = NULL, sigsize = 3, error = NULL, color = TRUE, opt = NULL )
data |
Output from summary data |
type |
Type of graphic. "bar" or "line" |
x |
Axis x variable |
y |
Axis y variable |
group |
Group variable |
xlab |
Title for the axis x |
ylab |
Title for the axis y |
glab |
Title for the legend |
ylimits |
limits of the y axis c(initial, end, brakes) |
xrotation |
Rotation in x axis c(angle, h, v) |
xtext |
Text labels in x axis using a vector |
gtext |
Text labels in group using a vector |
legend |
the position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector) |
sig |
Column with the significance |
sigsize |
Font size in significance letters |
error |
Show the error bar ("ste" or "std") |
color |
colored figure (TRUE), black & white (FALSE) or color vector |
opt |
Add news layer to the plot |
If the table is a out put of mean_comparison(graph_opts = TRUE)
function. Its contain all the parameter for the plot.
You could add additional layer to the plot using "+" with ggplot2 options
plot
## Not run: library(inti) fb <- potato yrs <- yupana_analysis(data = fb , response = "hi" , model_factors = "geno*treat" , comparison = c("geno", "treat") ) yrs$meancomp %>% plot_smr(type = "bar" , x = "geno" , y = "hi" , xlab = "" , group = "treat" , glab = "Tratamientos" , error = "ste" , sig = "sig" #, ylimits = c(0, 1, 0.2) , color = T #c("red", "black") , gtext = c("Irrigado", "Sequia") ) yrs$meancomp %>% plot_smr(type = "bar" , x = "treat" , y = "hi" , group = "geno" , glab = "Genotipo" , error = "ste" , sig = "sig" ) ## End(Not run)## Not run: library(inti) fb <- potato yrs <- yupana_analysis(data = fb , response = "hi" , model_factors = "geno*treat" , comparison = c("geno", "treat") ) yrs$meancomp %>% plot_smr(type = "bar" , x = "geno" , y = "hi" , xlab = "" , group = "treat" , glab = "Tratamientos" , error = "ste" , sig = "sig" #, ylimits = c(0, 1, 0.2) , color = T #c("red", "black") , gtext = c("Irrigado", "Sequia") ) yrs$meancomp %>% plot_smr(type = "bar" , x = "treat" , y = "hi" , group = "geno" , glab = "Genotipo" , error = "ste" , sig = "sig" ) ## End(Not run)
Plot fieldbook sketches for Splitplot-RCBD experimental designs generated
by design_split_rcbd().
plot_split_rcbd_design( data, factor = NA, fill = "plots", xlab = NULL, ylab = NULL, glab = NULL, text_size = NULL, wrap_width = NULL, font_family = "Open Sans", font_face = "plain" )plot_split_rcbd_design( data, factor = NA, fill = "plots", xlab = NULL, ylab = NULL, glab = NULL, text_size = NULL, wrap_width = NULL, font_family = "Open Sans", font_face = "plain" )
data |
Fieldbook data frame from |
factor |
Character scalar. Column used to color experimental units.
If missing, |
fill |
Character vector. Column or columns used as labels inside each
experimental unit. Default is |
xlab |
Character scalar. Optional x-axis title. If |
ylab |
Character scalar. Optional y-axis title. If |
glab |
Character scalar. Optional legend title. |
text_size |
Optional positive numeric scalar indicating the plot-label
font size in typographic points ( |
wrap_width |
Optional positive integer indicating the approximate
maximum number of characters per line. If |
font_family |
Character scalar. Font family used in the sketch.
Defaults to |
font_face |
Character scalar. Font face used in labels, axes, facet
titles and legends. Defaults to |
The function does not recalculate or rearrange the experimental design. It
uses the existing rows and cols coordinates from the fieldbook, so the
physical arrangement and zigzag order generated by Tarpuy are preserved.
Every experimental unit is positioned with cols on the x axis and rows
on the y axis. The block column is used only to identify the block panels;
it never replaces the physical row coordinate.
Within each block, cols represents whole-plot positions. The visible
y-axis tick labels are derived from the rank of the actual rows values
inside each block, so the panels can display subplot positions while the
geometry continues to use the original fieldbook coordinates. A black
external border identifies each whole plot.
Automatic wrapping affects only the displayed labels. It does not change
plots, ntreat, treatment factors, QR codes, rows, columns or any other
fieldbook value.
A ggplot object.
## Not run: plot_split_rcbd_design( data = fieldbook, factor = "wp_sp", fill = c("plots", "ntreat"), text_size = 9, font_family = "Open Sans", font_face = "plain" ) ## End(Not run)## Not run: plot_split_rcbd_design( data = fieldbook, factor = "wp_sp", fill = c("plots", "ntreat"), text_size = 9, font_family = "Open Sans", font_face = "plain" ) ## End(Not run)
Plot standard fieldbook sketches for regular experimental designs generated in Tarpuy, including completely randomized designs (CRD/DCA) and randomized complete block designs (RCBD/DBCA).
plot_standard_design( data, factor = NA, fill = "plots", xlab = NULL, ylab = NULL, glab = NULL, text_size = NULL, wrap_width = NULL, font_family = "Open Sans", font_face = "plain" )plot_standard_design( data, factor = NA, fill = "plots", xlab = NULL, ylab = NULL, glab = NULL, text_size = NULL, wrap_width = NULL, font_family = "Open Sans", font_face = "plain" )
data |
A fieldbook data frame. It must contain at least |
factor |
Character scalar. Name of the column used to color the
experimental units. If missing, |
fill |
Character vector. Names of one or more columns used as labels
inside each experimental unit. When |
xlab |
Character scalar. Title for the x axis. If |
ylab |
Character scalar. Title for the y axis. If |
glab |
Character scalar. Legend title. If |
text_size |
Optional positive numeric scalar indicating the plot-label
font size in typographic points ( |
wrap_width |
Optional positive integer indicating the approximate
maximum number of characters per line. If |
font_family |
Character scalar. Font family used by the sketch.
Defaults to |
font_face |
Character scalar. Font face used in labels, axes and
legends. Defaults to |
The function does not calculate or rearrange an experimental design. It uses
the existing rows and cols coordinates from the fieldbook, so the
physical layout and the zigzag order generated by Tarpuy are preserved.
All standard designs are plotted with cols on the x axis and rows on
the y axis. A DBCA/RCBD is therefore displayed according to its actual
physical coordinates rather than replacing the row coordinate with the
block number. When rows and blocks have a strict one-to-one relationship,
only the visible y-axis title changes to "Blocks". The block can still be
selected as the color factor.
Automatic wrapping affects only the sketch. It does not change entry,
ntreat, QR codes, factor levels or any other fieldbook value.
A ggplot object.
## Not run: plot_standard_design( data = fieldbook, factor = "geno", fill = c("plots", "entry"), text_size = 9, font_family = "Open Sans", font_face = "plain" ) ## End(Not run)## Not run: plot_standard_design( data = fieldbook, factor = "geno", fill = c("plots", "entry"), text_size = 9, font_family = "Open Sans", font_face = "plain" ) ## End(Not run)
Experiment to evaluate the physiological response from 15 potatos genotypes under water deficit condition. The experiment had a randomized complete block design with five replications. The stress started at 30 day after planting.
potatopotato
A data frame with 150 rows and 17 variables:
Water deficit treatments: sequia, irrigado
15 potato genotypes
blocks for the experimentl design
Relative chlorophyll content (SPAD) at 29 day after planting
Relative chlorophyll content (SPAD) at 84 day after planting
Relative water content (percentage) at 84 day after planting
Osmotic potential (Mpa) at 84 day after planting
leaf dry weight (g)
stem dry weight (g)
root dry weight (g)
tuber dry weight (g)
total biomass dry weight (g)
harvest index
total transpiration (l)
water use effiency (g/l)
tuber water use effiency (g/l)
leaf area (cm2)
Use the method M4 in Bernal Vasquez (2016). Bonferroni Holm test to judge residuals standardized by the re scaled MAD (BH MADR).
remove_outliers( data, formula, drop_na = FALSE, plot_diag = FALSE, title = "Diagnostic Plot" )remove_outliers( data, formula, drop_na = FALSE, plot_diag = FALSE, title = "Diagnostic Plot" )
data |
Experimental design data frame with the factors and traits. |
formula |
mixed model formula. |
drop_na |
drop NA values from the data.frame |
plot_diag |
Diagnostic plot based in the raw and clean data |
title |
Plot title |
Function to remove outliers in MET experiments
list. 1. Table with date without outliers. 2. The outliers in the dataset.
Bernal Vasquez, Angela Maria, et al. “Outlier Detection Methods for Generalized Lattices: A Case Study on the Transition from ANOVA to REML.” Theoretical and Applied Genetics, vol. 129, no. 4, Apr. 2016.
library(inti) rmout <- potato %>% remove_outliers(data = . , formula = stemdw ~ 0 + (1|bloque) + treat*geno , plot_diag = TRUE , drop_na = FALSE , title = "Plot Diagnostic" ) rmoutlibrary(inti) rmout <- potato %>% remove_outliers(data = . , formula = stemdw ~ 0 + (1|bloque) + treat*geno , plot_diag = TRUE , drop_na = FALSE , title = "Plot Diagnostic" ) rmout
Reads a Markdown file exported from Google Docs and converts it into a Quarto-compatible manuscript. The function detects and separates text, figures, and tables, removes formatting artifacts, restores equations embedded as image placeholders, and inserts format-specific section breaks. The resulting document can be rendered directly using Quarto for HTML, Word, or PDF outputs.
rticle(file = "render2rticle.md", export = "files", type = c("asis", "list"))rticle(file = "render2rticle.md", export = "files", type = c("asis", "list"))
file |
Character string indicating the path to the Markdown file. Default is "draft.md". |
export |
Character string specifying the output directory where the generated .qmd file will be saved. If NULL, the directory name is derived from the input file name. |
type |
Character string indicating how the manuscript should be organized. "asis" preserves the original structure, whereas "list" rearranges the content into text, figures, and tables. |
A character vector containing the full path of the generated Quarto (.qmd) file.
Function to split folder by size or number of elements
split_folder( folder, export, units = "megas", size = 500, zip = TRUE, remove = FALSE )split_folder( folder, export, units = "megas", size = 500, zip = TRUE, remove = FALSE )
folder |
Path of folder to split (path). |
export |
Path to export the split folders (path). |
units |
Units to split folder (string: "megas", "number"). |
size |
Folder size by the units selected (numeric). |
zip |
Zip split folders (logical). |
remove |
Remove the split folder after zip (logical). |
zip files
## Not run: split_folder("pictures/QUINOA 2018-2019 SC SEEDS EDWIN - CAMACANI/" , "pictures/split_num", remove = T, size = 400, units = "number") ## End(Not run)## Not run: split_folder("pictures/QUINOA 2018-2019 SC SEEDS EDWIN - CAMACANI/" , "pictures/split_num", remove = T, size = 400, units = "number") ## End(Not run)
Invoke RStudio addin to create fieldbook designs
tarpuy(dependencies = FALSE)tarpuy(dependencies = FALSE)
dependencies |
Logical. If |
TARPUY allows users to create experimental designs through an interactive Shiny application.
A Shiny application launched with shiny::runApp().
if (interactive()) { inti::tarpuy() }if (interactive()) { inti::tarpuy() }
Function to deploy the experimental designs currently supported by TARPUY.
tarpuy_design( data, nfactors = 1, type = "crd", rep = 2, zigzag = FALSE, nrows = NA, serie = 100, seed = NULL, project = NA, qrcode = "{project}{plots}" )tarpuy_design( data, nfactors = 1, type = "crd", rep = 2, zigzag = FALSE, nrows = NA, serie = 100, seed = NULL, project = NA, qrcode = "{project}{plots}" )
data |
Experimental design data frame containing factor names and
levels. A design sheet may also include the columns |
nfactors |
Number of factors in the experiment |
type |
Type of experimental arrangement |
rep |
Number of replications or blocks in the experiment
|
zigzag |
Arrange the physical layout in zigzag order
|
nrows |
Number of rows in the physical field layout. When missing, the corresponding design function calculates the layout. |
serie |
Base number used to generate plot identifiers
|
seed |
Seed used for reproducible randomization. |
project |
Barcode prefix for data collection. |
qrcode |
Template used to concatenate QR-code fields
|
The design sheet can include two optional columns named
{arguments} and {values}. Values supplied in those columns
override the corresponding function arguments. Factor columns are the
remaining columns whose names are not enclosed in braces ({}) or square
brackets ([]).
TARPUY currently dispatches only designs with an implemented and validated generator: CRD/DCA, RCBD/DBCA, augmented, and split-plot RCBD. Other design identifiers are rejected explicitly instead of being routed to incomplete generators.
A data frame containing the generated fieldbook.
## Not run: library(inti) library(gsheet) url <- paste0( "https://docs.google.com/spreadsheets/d/", "1510fOKj0g4CDEAFkrpFbr-zNMnle_Hou9O_wuf7Vdo4/edit" ) fb <- gsheet2tbl(url) dsg <- fb %>% tarpuy_design() dsg %>% tarpuy_plotdesign() ## End(Not run)## Not run: library(inti) library(gsheet) url <- paste0( "https://docs.google.com/spreadsheets/d/", "1510fOKj0g4CDEAFkrpFbr-zNMnle_Hou9O_wuf7Vdo4/edit" ) fb <- gsheet2tbl(url) dsg <- fb %>% tarpuy_design() dsg %>% tarpuy_plotdesign() ## End(Not run)
Information for build a plan for an experiment (PLEX)
tarpuy_plex( data = NULL, title = NULL, short_title = NULL, objective = NULL, references = NULL, plan = NULL, institutions = NULL, researchers = NULL, manager = NULL, location = NULL, altitude = NULL, georeferencing = NULL, environment = NULL, start = NA, end = NA, project = NULL, repository = NULL, manuscript = NULL, album = NULL, nfactor = 2, design = "rcbd", rep = 4, zigzag = FALSE, nrows = NA, serie = 1000, seed = 0, qrcode = "{project}{plots}", aug_blocks = NA, aug_eu_block = NA, aug_random = TRUE )tarpuy_plex( data = NULL, title = NULL, short_title = NULL, objective = NULL, references = NULL, plan = NULL, institutions = NULL, researchers = NULL, manager = NULL, location = NULL, altitude = NULL, georeferencing = NULL, environment = NULL, start = NA, end = NA, project = NULL, repository = NULL, manuscript = NULL, album = NULL, nfactor = 2, design = "rcbd", rep = 4, zigzag = FALSE, nrows = NA, serie = 1000, seed = 0, qrcode = "{project}{plots}", aug_blocks = NA, aug_eu_block = NA, aug_random = TRUE )
data |
Data with the fieldbook information. |
title |
Project title. |
short_title |
Short description of the project. |
objective |
The objectives of the project. |
references |
References. |
plan |
General description of the project (M & M). |
institutions |
Institutions involved in the project. |
researchers |
Persons involved in the project. |
manager |
Persons responsible of the collection of the data. |
location |
Location of the project. |
altitude |
Altitude of the experiment (m.a.s.l). |
georeferencing |
Georeferencing information. |
environment |
Environment of the experiment (greenhouse, lab, etc). |
start |
The date of the start of the experiments. |
end |
The date of the end of the experiments. |
project |
Name or ID for the fieldbook/project. |
repository |
link to the repository. |
manuscript |
link for manuscript. |
album |
link with the photos of the project. |
nfactor |
Number of factors for the design. |
design |
Type of design. |
rep |
Number of replication. |
zigzag |
Experiment layout in zigzag |
nrows |
Experimental design dimension by rows |
serie |
Number of digits in the plots. |
seed |
Seed for the randomization. A value of |
qrcode |
QR code template used to concatenate fieldbook identifiers. |
aug_blocks |
Optional number of blocks for augmented design. |
aug_eu_block |
Number of plots per block for augmented design. |
aug_random |
Logical. Randomize entries allocation in augmented design. |
Provide the information available.
data frame or list of arguments:
info
variables
design
logbook
timetable
budget
Plot fieldbook sketches according to the experimental design type.
tarpuy_plotdesign( data, factor = NA, fill = "plots", xlab = NULL, ylab = NULL, glab = NULL, text_size = NULL, wrap_width = NULL, font_family = "Open Sans", font_face = "plain" )tarpuy_plotdesign( data, factor = NA, fill = "plots", xlab = NULL, ylab = NULL, glab = NULL, text_size = NULL, wrap_width = NULL, font_family = "Open Sans", font_face = "plain" )
data |
Fieldbook data frame or a design object containing a fieldbook. |
factor |
Character scalar. Column used to color experimental units.
When omitted, |
fill |
Character vector. Column or columns used as labels inside the
experimental units. Defaults to |
xlab |
Character scalar. Optional x-axis title. When |
ylab |
Character scalar. Optional y-axis title. When |
glab |
Character scalar. Optional legend title. |
text_size |
Optional positive numeric scalar indicating the plot-label
font size in typographic points ( |
wrap_width |
Optional positive integer retained for backward
compatibility. When |
font_family |
Character scalar retained for programmatic use. Defaults
to |
font_face |
Character scalar retained for programmatic use. One of
|
This function is the common plotting interface used by TARPUY. It reads the design stored in the fieldbook, chooses the corresponding plotter and sends the same plotting arguments to all supported design types.
Supported designs and plotters are:
CRD and RCBD: plot_standard_design().
Augmented: plot_augmented_design().
Splitplot-RCBD: plot_split_rcbd_design().
The function never recalculates or rearranges the design. All plotters use
cols as the x coordinate and rows as the y coordinate. Columns such as
block are used only for labels, grouping or faceting.
wrap_width, font_family and font_face remain available to avoid
breaking existing programmatic calls, but the TARPUY frontend should expose
only the general text_size control. Automatic label wrapping is used when
wrap_width = NULL.
A ggplot object.
## Not run: tarpuy_plotdesign( data = fieldbook, factor = "auto", fill = c("plots", "ntreat"), text_size = 9 ) ## End(Not run)## Not run: tarpuy_plotdesign( data = fieldbook, factor = "auto", fill = c("plots", "ntreat"), text_size = 9 ) ## End(Not run)
Function to export a field book and its trait definitions for use in the Field Book app.
tarpuy_traits(fieldbook = NULL, last_factor = NULL, traits = NULL)tarpuy_traits(fieldbook = NULL, last_factor = NULL, traits = NULL)
fieldbook |
Experimental field book |
last_factor |
Optional name of the last structural column to include in
the CSV exported to Field Book |
traits |
Traits information |
The trait sheet can contain the columns variable, {trait}, {when},
{samples}, {format}, units, details, and categories.
Spaces inside {trait}, {when}, and the textual part of {samples} are
removed. The components are joined with underscores. For example,
{trait} = "G", {when} = "Dia 1", and {samples} = "plant3" generate
G_Dia1_plant1, G_Dia1_plant2, and G_Dia1_plant3.
A list with four elements:
fieldbook: the field book including empty trait columns;
traits: the trait definition table used to export the .trt file;
fb: the base field book used to export the Field Book CSV;
metadata: internal mapping between a stable Trait ID and every generated
fieldbook column. This element is used by TARPUY and is not exported to the
fieldbook or to Field Book mobile files.
library(inti) fieldbook <- inti::potato traits <- list( list( variable = "altura de planta", trait = "altp", format = "numeric", when = "Dia 30, Dia 40, Dia 50", samples = "plant3", units = "cm", details = NA, minimum = 0, maximum = 100 ), list( variable = "severidad", trait = "svr", format = "scategorical", when = "30, 40, 50", samples = 1, units = "scale", details = NA, categories = "1, 3, 5, 7, 9" ), list( variable = "foto", trait = "foto", format = "photo", when = "hrv, pshrv", samples = NA, units = "image", details = NA ), list( variable = "germinacion", trait = "G", format = "boolean", when = "0, 1, 2", samples = 1, units = "logical", details = NA ) ) fbapp <- tarpuy_traits(fieldbook, last_factor = "bloque", traits) ## Not run: library(inti) library(gsheet) url_ds <- paste0( "https://docs.google.com/spreadsheets/d/", "1510fOKj0g4CDEAFkrpFbr-zNMnle_Hou9O_wuf7Vdo4/edit?gid=1278145622" ) ds <- gsheet2tbl(url_ds) fb <- ds |> tarpuy_design() url_trt <- paste0( "https://docs.google.com/spreadsheets/d/", "1510fOKj0g4CDEAFkrpFbr-zNMnle_Hou9O_wuf7Vdo4/edit?gid=1665653985" ) traits <- gsheet2tbl(url_trt) fbapp <- tarpuy_traits(fb, last_factor = "cols", traits) ## End(Not run)library(inti) fieldbook <- inti::potato traits <- list( list( variable = "altura de planta", trait = "altp", format = "numeric", when = "Dia 30, Dia 40, Dia 50", samples = "plant3", units = "cm", details = NA, minimum = 0, maximum = 100 ), list( variable = "severidad", trait = "svr", format = "scategorical", when = "30, 40, 50", samples = 1, units = "scale", details = NA, categories = "1, 3, 5, 7, 9" ), list( variable = "foto", trait = "foto", format = "photo", when = "hrv, pshrv", samples = NA, units = "image", details = NA ), list( variable = "germinacion", trait = "G", format = "boolean", when = "0, 1, 2", samples = 1, units = "logical", details = NA ) ) fbapp <- tarpuy_traits(fieldbook, last_factor = "bloque", traits) ## Not run: library(inti) library(gsheet) url_ds <- paste0( "https://docs.google.com/spreadsheets/d/", "1510fOKj0g4CDEAFkrpFbr-zNMnle_Hou9O_wuf7Vdo4/edit?gid=1278145622" ) ds <- gsheet2tbl(url_ds) fb <- ds |> tarpuy_design() url_trt <- paste0( "https://docs.google.com/spreadsheets/d/", "1510fOKj0g4CDEAFkrpFbr-zNMnle_Hou9O_wuf7Vdo4/edit?gid=1665653985" ) traits <- gsheet2tbl(url_trt) fbapp <- tarpuy_traits(fb, last_factor = "cols", traits) ## End(Not run)
Export tables with download, pasta and copy buttons
web_table( data, caption = NULL, digits = 2, rnames = FALSE, buttons = NULL, file_name = "file", scrolly = "45vh", columnwidth = "200px", width = "100%" )web_table( data, caption = NULL, digits = 2, rnames = FALSE, buttons = NULL, file_name = "file", scrolly = "45vh", columnwidth = "200px", width = "100%" )
data |
Dataset. |
caption |
Title for the table. |
digits |
Digits number in the table exported. |
rnames |
Row names. |
buttons |
Buttons: "excel", "copy" or "none". Default c("excel", "copy") |
file_name |
Excel file name |
scrolly |
Windows height to show the table. Default "45vh" |
columnwidth |
Column width. Default '200px' |
width |
Width in pixels or percentage (Defaults to automatic sizing) |
table in markdown format for html documents
## Not run: library(inti) met %>% web_table(caption = "Web table") ## End(Not run)## Not run: library(inti) met %>% web_table(caption = "Web table") ## End(Not run)
Invoke RStudio addin to analyze and graph experimental design data
yupana(dependencies = FALSE)yupana(dependencies = FALSE)
dependencies |
Install package dependencies for run the app |
Yupana: data analysis and graphics for experimental designs.
Shiny app
if(interactive()){ inti::yupana() }if(interactive()){ inti::yupana() }
Function to create a complete report of the fieldbook
yupana_analysis( data, last_factor = NULL, response, model_factors, comparison, test_comp = "SNK", sig_level = 0.05, plot_dist = "boxplot", plot_diag = FALSE, digits = 2 )yupana_analysis( data, last_factor = NULL, response, model_factors, comparison, test_comp = "SNK", sig_level = 0.05, plot_dist = "boxplot", plot_diag = FALSE, digits = 2 )
data |
Field book data. |
last_factor |
The last factor in your fieldbook. |
response |
Response variable. |
model_factors |
Model used for the experimental design. |
comparison |
Factors to compare |
test_comp |
Comprasison test c("SNK", "TUKEY", "DUNCAN") |
sig_level |
Significal test (default: p = 0.005) |
plot_dist |
Plot data distribution (default = "boxplot") |
plot_diag |
Diagnostic plots for model (default = FALSE). |
digits |
Digits number in the table exported. |
list
## Not run: library(inti) fb <- potato rsl <- yupana_analysis(data = fb , last_factor = "bloque" , response = "spad_83" , model_factors = "geno * treat" , comparison = c("geno", "treat") ) ## End(Not run)## Not run: library(inti) fb <- potato rsl <- yupana_analysis(data = fb , last_factor = "bloque" , response = "spad_83" , model_factors = "geno * treat" , comparison = c("geno", "treat") ) ## End(Not run)
Function to export the graph options and model parameters
yupana_export( data, type = NA, xlab = NA, ylab = NA, glab = NA, ylimits = NA, xrotation = c(0, 0.5, 0.5), xtext = NA, gtext = NA, legend = "top", sig = NA, error = NA, color = TRUE, opt = NA, dimension = c(20, 10, 100) )yupana_export( data, type = NA, xlab = NA, ylab = NA, glab = NA, ylimits = NA, xrotation = c(0, 0.5, 0.5), xtext = NA, gtext = NA, legend = "top", sig = NA, error = NA, color = TRUE, opt = NA, dimension = c(20, 10, 100) )
data |
Result from yupana_analysis or yupana_import. |
type |
Plot type |
xlab |
Title for the axis x |
ylab |
Title for the axis y |
glab |
Title for the legend |
ylimits |
limits of the y axis |
xrotation |
Rotation in x axis c(angle, h, v) |
xtext |
Text labels in x axis |
gtext |
Text labels in group |
legend |
the position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector) |
sig |
Column with the significance |
error |
Show the error bar ("ste" or "std"). |
color |
colored figure (TRUE), otherwise black & white (FALSE) |
opt |
Add news layer to the plot |
dimension |
Dimension of graphs |
data frame
## Not run: library(inti) library(gsheet) url <- paste0("https://docs.google.com/spreadsheets/d/" , "15r7ZwcZZHbEgltlF6gSFvCTFA-CFzVBWwg3mFlRyKPs/edit#gid=172957346") # browseURL(url) fb <- gsheet2tbl(url) smr <- yupana_analysis(data = fb , last_factor = "bloque" , response = "spad_83" , model_factors = "block + geno*riego" , comparison = c("geno", "riego") ) gtab <- yupana_export(smr, type = "line", ylimits = c(0, 100, 2)) #> import url <- paste0("https://docs.google.com/spreadsheets/d/" , "15r7ZwcZZHbEgltlF6gSFvCTFA-CFzVBWwg3mFlRyKPs/edit#gid=1202800640") # browseURL(url) fb <- gsheet2tbl(url) info <- yupana_import(fb) etab <- yupana_export(info) info2 <- yupana_import(etab) etab2 <- yupana_export(info2) ## End(Not run)## Not run: library(inti) library(gsheet) url <- paste0("https://docs.google.com/spreadsheets/d/" , "15r7ZwcZZHbEgltlF6gSFvCTFA-CFzVBWwg3mFlRyKPs/edit#gid=172957346") # browseURL(url) fb <- gsheet2tbl(url) smr <- yupana_analysis(data = fb , last_factor = "bloque" , response = "spad_83" , model_factors = "block + geno*riego" , comparison = c("geno", "riego") ) gtab <- yupana_export(smr, type = "line", ylimits = c(0, 100, 2)) #> import url <- paste0("https://docs.google.com/spreadsheets/d/" , "15r7ZwcZZHbEgltlF6gSFvCTFA-CFzVBWwg3mFlRyKPs/edit#gid=1202800640") # browseURL(url) fb <- gsheet2tbl(url) info <- yupana_import(fb) etab <- yupana_export(info) info2 <- yupana_import(etab) etab2 <- yupana_export(info2) ## End(Not run)
Graph summary data
yupana_import(data)yupana_import(data)
data |
Summary information with options |
list
## Not run: library(inti) library(gsheet) url <- paste0("https://docs.google.com/spreadsheets/d/" , "15r7ZwcZZHbEgltlF6gSFvCTFA-CFzVBWwg3mFlRyKPs/edit?gid=2137596914#gid=2137596914") # browseURL(url) fb <- gsheet2tbl(url) info <- yupana_import(fb) ## End(Not run)## Not run: library(inti) library(gsheet) url <- paste0("https://docs.google.com/spreadsheets/d/" , "15r7ZwcZZHbEgltlF6gSFvCTFA-CFzVBWwg3mFlRyKPs/edit?gid=2137596914#gid=2137596914") # browseURL(url) fb <- gsheet2tbl(url) info <- yupana_import(fb) ## End(Not run)
Multivariate analysis for PCA and HCPC
yupana_mvr( data, last_factor = NULL, summary_by = NULL, groups = NULL, variables = NULL )yupana_mvr( data, last_factor = NULL, summary_by = NULL, groups = NULL, variables = NULL )
data |
Field book data. |
last_factor |
The last factor in your fieldbook |
summary_by |
Variables for group the analysis. |
groups |
Groups for color in PCA. |
variables |
Variables to be use in the analysis |
Compute and plot information for multivariate analysis (PCA, HCPC and correlation).
result and plots
## Not run: library(inti) fb <- inti::potato mv <- yupana_mvr(data = fb , last_factor = "geno" , summary_by = c("geno", "treat") , groups = "treat" , variables = c("all") #, variables = c("wue", "twue") ) mv$plot[1] mv$data ## End(Not run)## Not run: library(inti) fb <- inti::potato mv <- yupana_mvr(data = fb , last_factor = "geno" , summary_by = c("geno", "treat") , groups = "treat" , variables = c("all") #, variables = c("wue", "twue") ) mv$plot[1] mv$data ## End(Not run)
Function to reshape fieldbook according a separation character
yupana_reshape( data, last_factor, sep, new_colname, from_var = NULL, to_var = NULL, exc_factors = NULL )yupana_reshape( data, last_factor, sep, new_colname, from_var = NULL, to_var = NULL, exc_factors = NULL )
data |
Field book raw data. |
last_factor |
The last factor in your field book. |
sep |
Character that separates the last value. |
new_colname |
The new name for the column created. |
from_var |
The first variable in case you want to exclude several. variables. |
to_var |
The last variable in case you want to exclude several variables. |
exc_factors |
Factor to exclude during the reshape. |
If you variable name is variable_evaluation_rep. The reshape function
will help to create the column rep and the new variable name will be
variable_evaluation.
data frame