addMissing {polySegratio} | R Documentation |
Adds missing data to objects of class autoMarker or autoCross
Description
Adds missing data to objects of class simAutoMarkers
or
simAutoCross
as specified either as a proportion of missing at
random or a proportion of columns and rows with specified proportions
of missings.
Usage
addMissing(x, na.proportion = 0, parent.cols = c(1, 2), seed)
Arguments
x |
object of class |
na.proportion |
proportion missing at random or a list with two components indiv and marker each containing c(prop. markers missing, prop. missing) (Default: 0) |
parent.cols |
columns containing parental markers (etc) not
altered only used if object of class |
seed |
random number generator (RNG) state for random number which will be set at start to reproduce results |
Value
Returns object of class simAutoMarkers
or simAutoCross
, or a
matrix
with dominant markers scored as 0 or 1 with extra
component na.proportion
which has the following elements
na.proportion |
proportion missing at random or a list with two components indiv and marker each containing c(prop. markers missing, prop. missing) |
time.generated |
time/date when data set generated + when missing added |
seed |
random number generator seed which could be used to reproduce results (I hope) |
call |
matches arguments when function called |
Author(s)
Peter Baker p.baker1@uq.edu.au
See Also
addMisclass
misclassifies markers at random,
sim.autoMarkers
simulate autopolyploid markers,
sim.autoCross
simulate autopolyploid markers for a cross
Examples
## simulate autopolyploid markers
p1 <- sim.autoCross(4, dose.proportion=c(0.7,0.3), n.markers=20, n.indiv=10)
p2 <- sim.autoCross(4, dose.proportion=list(p01=c(0.7,0.3),p10=c(0.7,0.3),p11=c(
0.6,0.2,0.2)))
## add missings
addMissing(p2, 0.1)