rm_outlier_df: Remove Outlier from Normalized Rootdetection Data Set

View source: R/data_processing.R

rm_outlier_dfR Documentation

Remove Outlier from Normalized Rootdetection Data Set

Description

The function removes or replaces outliers for every grouping variable (Label) present in a Normalized Rootdetection Data Set. According to outlier definition in box plots the function defines outliers as 1.5 x IQR.

Usage

rm_outlier_df(
  root_norm,
  col_grouping = "Label",
  col_value = "LengthMM",
  fill_na = F
)

Arguments

root_norm

data.frame; normalized Rootdetection data set

col_grouping

string; name of the column that should be used as grouping variable (Label)

col_value

string; name of the column containing values (dependent variable) (LengthMM)

fill_na

logical; If TRUE all outliers present in col_value will be replaced by NA. If FALSE all outliers will be removed.

Value

data.frame; containing data without outliers or outliers replaced by NA

Examples

# normalize Rootdetection Output
root_norm <- norm_10mm_standard(root_output)

# transform outliers to NA
rm_outlier_df(root_norm, fill_na = TRUE)
# remove outliers
rm_outlier_df(root_norm, fill_na = FALSE)

PhilippJanitza/rootdetectR documentation built on Feb. 24, 2024, 6:46 a.m.