View source: R/helpful_functions.R
rm_outlier | R Documentation |
This function removes outlier from a vector or replaced outliers by NA. According to box plots the function defines outliers as 1.5 x IQR. Caution: NAs already present in the input vector will be removed first.
rm_outlier(x, fill_na = F)
x |
numeric vector |
fill_na |
logical; If TRUE all outliers present in x will be replaced by NA. If FALSE all outliers will be deleted. |
numeric vector; without outliers or outliers replaced by NA
# get some example vector
root_norm <- norm_10mm_standard(root_output)
x <- root_norm[root_norm$Label == "weitar1_1;28", ]$LengthMM
# delete outliers
rm_outlier(x, fill_na = FALSE)
# replace outliers with NA
rm_outlier(x, fill_na = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.