collect: collect function

Description Usage Arguments Value Author(s) Examples

View source: R/rrr_functions.R

Description

Collects all outputs saved at the provided saveAt parameter from the SSI analysis when testing data was splited according to argument subset.

Usage

1
collect(prefix = "")

Arguments

prefix

(character) Prefix that was added to the output files name, this may include a path

Value

An object of the class 'SSI' for which methods fitted, plot and summary exist

Author(s)

Marco Lopez-Cruz (maraloc@gmail.com) and Gustavo de los Campos

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  require(SFSI)
  data(wheatHTP)
  
  index = which(Y$CV == 1)             # Use only a subset of data
  M = scale(M[index,])/sqrt(ncol(M))   # Subset and scale markers
  G = tcrossprod(M)                    # Genomic relationship matrix
  y = as.vector(scale(Y[index,"E1"]))  # Subset response variable

  prefix <- paste0(tempdir(),"/testSSI")
  
  # Run the analysis into 4 subsets and save them at a given prefix
  fm <- SSI(y,K=G,tst=1:80,trn=81:length(y),subset=c(1,4),saveAt=prefix)
  fm <- SSI(y,K=G,tst=1:80,trn=81:length(y),subset=c(2,4),saveAt=prefix)
  fm <- SSI(y,K=G,tst=1:80,trn=81:length(y),subset=c(3,4),saveAt=prefix)
  fm <- SSI(y,K=G,tst=1:80,trn=81:length(y),subset=c(4,4),saveAt=prefix)

  # Collect all results after completion
  fm <- collect(prefix)

SFSI documentation built on Oct. 1, 2021, 1:08 a.m.