plot_TS: Plot G-BLUEs time series data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/plot_TS.R

Description

Plot G-BLUEs time series data.

Usage

1
plot_TS(data_TS, trend = NULL, h2 = NULL, TW_lim = NULL, main = "G-BLUEs TS")

Arguments

data_TS

numeric matrix of dimension N_genotype x N_days containing the phenotype information. the different columns represent the different time points (e.g. days, hours) of measurement.

trend

Optional numeric matrix of dimension n_days containing the values of the trend to be ploted on the top of the time series Default = NULL.

h2

Optional heritability numeric vector that will be used to indicate the day with the highest heritability. Default = NULL.

TW_lim

Optional time window limits numeric vector that will be used to indicate the time window limit days. Those values can be obtained with cpa_getOTW_2. Default = NULL.

main

Character string representing the title of the graph. Default = 'G-BLUEs TS'.

Details

The function plots the times series data of phenotyping data per genotype replicate or averaged over genotype replicate using the ggplot2 package.

Value

Plot of the G-BLUEs time series. The optional trend will be ploted in red. The heritability will be ploted in dashed blue and time window limits in black.

Author(s)

Soumyashree Kar, Vincent Garin

See Also

SpaTemHTP_proc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(SG_PH_data)
data <- SG_PH_data
geno_id <- data$genotype

g_means <- matrix(NA, 384, 23)

for(i in 1:23){
  
  g_av <- tapply(X = data[, i + 5], INDEX = geno_id,
                 FUN = function(x) mean(x, na.rm = TRUE))
  g_means[, i] <- g_av
  
}

rownames(g_means) <- names(g_av)

plot_TS(data_TS = g_means, main = 'Raw data genotype means')

ICRISAT-GEMS/SpaTemHTP documentation built on March 9, 2021, 12:12 a.m.