Learn R Programming

relSim (version 1.0.0)

readResults: Read a simulation result set from file

Description

This function will read the output from sim that has been saved to disk

Usage

readResults(
  N = 0,
  rel = "UN",
  gzip = TRUE,
  strPath = "",
  strVer = "",
  fileName = NULL
)

Value

a data frame with three columns labelled sib, pc, and ibs. These represent the LRs for sibs and parent-child calculated on each simulated profile pair, and the number of matching alleles (IBS).

Arguments

N

The number of iterations in the simulation

rel

'UN' = unrelated, 'FS' = full-sib, 'PC' = parent-child

gzip

If TRUE then it is assumed that the file is compressed

strPath

Optional location of files. Must terminate with / otherwise it will not work

strVer

A version string, useful if more than simulation has been run

fileName

This argument allows the user to override the default file naming conventions of the result file

Author

James M. Curran

Details

The arguments to this file are used to generate the input file name. The format is very rigid, being 'results-sim-rel-N(-strVer).csv(.gz)' That is, if strVer is something than an empty string then it is included after the number of interations. Similarly if gzip == TRUE then the filename is assumed to end with '.gz'

See Also

sim

Examples

Run this code

data(fbiCaucs)
## not run
## write the results of 100 unrelated profile pairs to
## results-sim-UN-100.csv.gz
## and read it back in
if (FALSE) {
sim(100, save = T)
unrel = readResults(100)
sim(100, rel = "FS", strVer = "01", save = T)
sibs = readResults(100, rel = "FS", strVer = "01")
}

Run the code above in your browser using DataLab