plotCV: Plot a CV scheme based on crossValidate function

Description Usage Arguments Value Author(s) Examples

Description

Function to graphically show a CV scheme made by the crossValidate function

Usage

1
plotCV(data, scheme, title)

Arguments

data

a data frame with at least the following information:

GERMPLASM:

Name of then entries.

LOCATION:

Name of the geographic locations of the multi-field trial.

scheme

data frame output from the crossValidate function which was based on a user decided sampling strategy to use in the cross-validation.

title

character defining the title of the plot

Value

plot based on the ggplot package which shows the splitting of the training and validation sets for the first replication. Further, the plot is split by the levels of the chosen factor, which is generally the location.

Author(s)

Ruud Derijcker

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data(exampleCV)
scheme1 <- crossValidate(x=exampleCV, id="GERMPLASM", factor="LOCATION",
                         k=5, replication=3, seed=NULL, exclusive=TRUE,
                         sampling="randomByFactor",verbose=TRUE)
scheme2 <- crossValidate(x=exampleCV, id="GERMPLASM", factor="LOCATION",
                         k=5, replication=3, seed=NULL, exclusive=TRUE,
                         sampling="incompleteTrial",verbose=TRUE)
scheme3 <- crossValidate(x=exampleCV, id="GERMPLASM", factor="LOCATION",
                         k=5, replication=3, seed=NULL, exclusive=TRUE,
                         sampling="randomAccrossFactor",verbose=TRUE)
scheme4 <- crossValidate(x=exampleCV, id="GERMPLASM", factor="LOCATION",
                         k=5, replication=3, seed=NULL, exclusive=TRUE,
                         sampling="randomWithinFactor",verbose=TRUE)
scheme5 <- crossValidate(x=exampleCV, id="GERMPLASM", factor="LOCATION",
                         k=5, replication=3, seed=NULL, exclusive=TRUE,
                         sampling="randomByID",verbose=TRUE)

plotCV(exampleCV, scheme1, "CV-scheme based on randomByFactor")
plotCV(exampleCV, scheme2, "CV-scheme based on incompleteTrial")
plotCV(exampleCV, scheme3, "CV-scheme based on randomAccrossFactor")
plotCV(exampleCV, scheme4, "CV-scheme based on randomWithinFactor")
plotCV(exampleCV, scheme5, "CV-scheme based on randomByID")

digiYozhik/msc_thesis documentation built on May 14, 2019, 5:16 p.m.