This procedures aims to streighten (clean) the most extreme of noisy replicates by identifying the most distant points
(among a set of replicates). The input 'x' (matrix or data.frame) is supposed to come from multiple different measures taken
in replicates (eg weight of different individuals as rows taken as multiple replicate measures in subsequent columns).
With the argument nOutl
the user chooses the total number of most extreme values to replace by NA
.
how many of the most extreme replicates of the whole dataset will replaced by NA
, ie with nOutl=1
only the single most extreme outlyer will be replaced by NA
.
Outlier points are determined as point(s) with highest distance to (row) center (median and mean choice via argument 'centrMeth').
Returns input data with "removed" points set to NA
, or if retOffPos=TRUE
the most extreme/outlier positions.
cleanReplicates(
x,
centrMeth = "median",
nOutl = 2,
retOffPos = FALSE,
silent = FALSE,
callFrom = NULL
)
matrix (or data.frame)
(character) method to summarize (mean or median)
(integer) determines how many points per line will be set to NA (with n=1 the worst row of replicates will be 'cleaned')
(logical) if TRUE
, replace the most extreme outlyer only
(logical) suppres messages
(character) allow easier tracking of message(s) produced
input data with "removed" points set as NA
, or if retOffPos=TRUE
the most extreme/outlier positions
# NOT RUN {
mat3 <- matrix(c(19,20,30, 18,19,28, 16,14,35),ncol=3)
cleanReplicates(mat3,nOutl=1)
# }
Run the code above in your browser using DataLab