Skip to contents

Adds values (for example a second trait, or the same trait with another statistic) to the plots of an analysis saved before, e.g. with save_breedbase_analysis(). Breedbase names the plots of an analysis "<analysis_name>_<field plot name>" ("Analysis of: plots") or "<analysis_name>_<accession>" ("Analysis of: accessions"); the values are uploaded to those plots with the phenotype upload of the website (simple spreadsheet), which first verifies the file and then stores it.

Usage

add_breedbase_analysis_values(
  data,
  con,
  analysis_name,
  level = c("plot", "accession"),
  traits = NULL,
  plot = "plot_name",
  accession = "accession",
  statistic = NULL,
  overwrite = FALSE,
  dry_run = FALSE,
  confirm = interactive()
)

Arguments

data

A data frame with the field plot names (level = "plot") or the accession names (level = "accession") and one numeric column per trait, e.g. from first_stage_values() or second_stage_values().

con

A connection from breedbase_login() (the site's web pages must be open; see breedbase_login()).

analysis_name

Name of the existing analysis.

level

"plot" or "accession", as the analysis was saved.

traits

Trait columns (default: all except the name and design columns). Their names are Breedbase trait names, including composed traits such as "dry matter content percentage|Adjusted Means from Spatial Correction using SpATS R" (see breedbase_adjusted_trait()).

plot, accession

Names of the plot-name and accession columns.

statistic

Optional statistic (see breedbase_statistics()): the values are then stored under "trait|statistic" (a composed trait, created if needed), e.g. the single-stage means next to the two-stage means in the same analysis.

overwrite

Logical. Replace values already stored.

dry_run

Logical. Only verify (Breedbase checks the file), store nothing.

confirm

Logical. Ask before storing (default in interactive sessions).

Value

Invisibly, a list with the analysis name, the number of plots and values sent, and Breedbase's messages.

Details

Values already present for a plot and trait are not replaced unless overwrite = TRUE: the verification lists them and the upload stops.

Examples

if (FALSE) { # \dontrun{
con <- breedbase_login("https://cassava-test.sgn.cornell.edu", "jdoe", site_username = "sgn")
# dm1: first-stage values of dry matter, one row per field plot
add_breedbase_analysis_values(dm1, con, analysis_name = "FALL_2026_stage1", level = "plot")
} # }