create.dd: Create potatobase and sweetpotatobase design and data files

View source: R/create_dd.R

create.ddR Documentation

Create potatobase and sweetpotatobase design and data files

Description

Creates potatobase and sweetpotatobase design and phenotypic data files for a set of fieldbooks.

Usage

create.dd(crop = c("pt", "sp"), metadata)

Arguments

crop

pt for potato or sp for sweetpotato.

metadata

The name of the metadata template file.

Details

The metadata template can be created with function create.md. The fieldbooks should be in memory or as csv files in the working directory, with the same names specified in the column trial_name of the metadata, with standard short labels (see ?check.names.pt and ?check.names.sp for the details).

Value

It returns data.frames with names design.file and data.file ready to upload into potatobase and sweetpotatobase. Both data.frames should be saved as xlsx files.

Author(s)

Raul Eyzaguirre.

Examples

# Create designs
book1 <- cr.rcbd(1:20, 3, 10)$book
book2 <- cr.rcbd(1:20, 3, 10)$book
# Get fieldbook with minimal set of traits for sweetpotato
PEP2023CLM_AT01 <- create.fb.sp(book1)
PEP2023CSR_AT02 <- create.fb.sp(book2)
# Create metadata file
metadata <- create.md(trial_name = c('PEP2023CLM_AT01', 'PEP2023CSR_AT02'),
                      breeding_program = 'Peru-CIP',
                      location = c('CLM', 'CSR'),
                      year = 2023,
                      design_type = 'RCBD',
                      description = '20 genotypes with 3 complete blocks',
                      trial_type = 'Advanced Yield Trial')
# Create design and data files for sweetpotatobase
output <- create.dd('sp', metadata)

reyzaguirre/st4gi documentation built on April 20, 2024, 3:53 a.m.