| Title: | Detect Outliers in Data Frames and Export Results |
|---|---|
| Description: | Identifies potential outliers in numeric columns of a data frame using the interquartile range (IQR), defined as the difference between the third and first quartiles. Values below the first quartile minus 1.5 times the IQR or above the third quartile plus 1.5 times the IQR are flagged as potential outliers. The package can export rows containing outliers to comma-separated values (CSV) files and create 'Excel' workbooks with outlier values highlighted and a summary of outlier counts. |
| Authors: | Prakash Kumar [aut, cre], Himadri Sekhar Roy [aut], Ranjit Kumar Paul [aut], Md. Yeasin [aut], Paritosh Kumar ICAR-NIASM [aut], Amrit Kumar Paul [aut] |
| Maintainer: | Prakash Kumar <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.1 |
| Built: | 2026-10-21 20:50:43 UTC |
| Source: | https://github.com/cran/DetectOutlier |
Identifies potential outliers in a numeric vector using the interquartile range (IQR), calculated as the third quartile minus the first quartile. Values below the first quartile minus 1.5 times the IQR or above the third quartile plus 1.5 times the IQR are flagged. Missing values remain missing in the returned logical vector.
detect_outliers_iqr(x)detect_outliers_iqr(x)
x |
A numeric vector. |
A logical vector indicating whether each value is an outlier. Missing values in 'x' produce missing values in the result.
[run_outlier_analysis()]
x <- c(1, 2, 3, 100) detect_outliers_iqr(x)x <- c(1, 2, 3, 100) detect_outliers_iqr(x)
Reads a comma-separated values (CSV) file, detects potential outliers in numeric columns using the interquartile range (IQR) method, and writes two files to a directory specified by the user: a CSV file containing rows with outliers and an 'Excel' workbook with outlier values highlighted and an outlier-count summary. The function does not create files in the working directory unless that directory is explicitly supplied as 'output_dir'.
run_outlier_analysis(file, output_dir, verbose = FALSE)run_outlier_analysis(file, output_dir, verbose = FALSE)
file |
Path to the input CSV file. |
output_dir |
Existing directory in which output files will be written. |
verbose |
Logical; if 'TRUE', display progress messages. Defaults to 'FALSE'. |
Invisibly returns a list with 'summary', 'outliers', and 'files' elements. 'files' contains the paths of the two output files.
[detect_outliers_iqr()]
example_file <- system.file("extdata", "example_data.csv", package = "DetectOutlier") if (nzchar(example_file)) { result <- run_outlier_analysis(example_file, output_dir = tempdir()) }example_file <- system.file("extdata", "example_data.csv", package = "DetectOutlier") if (nzchar(example_file)) { result <- run_outlier_analysis(example_file, output_dir = tempdir()) }