add_param: add_param

Description Usage Arguments Details Value Examples

View source: R/add_param.R

Description

The function adds a new parameter to the dataset and performs a backup. It requires two files: the first containing the actual new parameter data. Inside the file three fields are mandatory: "accession_id", "accession_name", "value". The second file reports all the metadata information. (Note that environmental and phenotypical parameters have different sets of metadata. They need to be stored with the correct number of fields and in the correct order). Both the files are in .csv format.

Usage

1
add_param(ap.newparam, ap.metadata, ap.mode = F, ap.bk = normalizePath("~"))

Arguments

ap.newparam

Character. Indicates the filename (csv) of the new parameter data. It has to contain at least three fields: accession_id, accession_name, value

ap.metadata

Character. Indicates the metadata filename (csv).

ap.mode

Flag. F (default) for phenotypical parameter, T for environmental

ap.bk

Character. Path to the backup folder. (default home folder).

Details

After the data file has been read it's fileterd so that only the ecotypes among our selection of 1131 are retained; then the new data are saved in the exaustive corresponding table (phenotypical or environmental).

Finally the complete dataset is backed up and two sets of tables are printed: one tagged by the current date, to keep track of history of modifications and a second set tagged as "current" for the actual use and reference.

Value

NULL. It automatically writes a backup.

Examples

1
2
3
4
# Example with environmental data
fl = system.file("extdata", "example_add_param.csv", package = "daphneg2")
mt = system.file("extdata", "example_add_param_meta.csv", package = "daphneg2")
add_param(fl, mt, TRUE)

pezzcvd/daphneg2 documentation built on Oct. 13, 2021, 10:34 p.m.