| Type: | Package |
| Title: | Detect Outliers in Data Frames and Export Results |
| Version: | 0.1.1 |
| Maintainer: | Prakash Kumar <prakash289111@gmail.com> |
| 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. |
| Depends: | R (≥ 4.0) |
| Imports: | openxlsx |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| NeedsCompilation: | no |
| Packaged: | 2026-10-13 04:36:59 UTC; iasri |
| Author: | Prakash Kumar [aut, cre], Himadri Sekhar Roy [aut], Ranjit Kumar Paul [aut], Md. Yeasin [aut], Paritosh Kumar ICAR-NIASM [aut], Amrit Kumar Paul [aut] |
| Repository: | CRAN |
| Date/Publication: | 2026-10-21 17:30:09 UTC |
Detect Outliers Using the Interquartile Range Method
Description
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.
Usage
detect_outliers_iqr(x)
Arguments
x |
A numeric vector. |
Value
A logical vector indicating whether each value is an outlier. Missing values in 'x' produce missing values in the result.
See Also
[run_outlier_analysis()]
Examples
x <- c(1, 2, 3, 100)
detect_outliers_iqr(x)
Run Outlier Detection and Export Results
Description
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'.
Usage
run_outlier_analysis(file, output_dir, verbose = FALSE)
Arguments
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'. |
Value
Invisibly returns a list with 'summary', 'outliers', and 'files' elements. 'files' contains the paths of the two output files.
See Also
[detect_outliers_iqr()]
Examples
example_file <- system.file("extdata", "example_data.csv",
package = "DetectOutlier")
if (nzchar(example_file)) {
result <- run_outlier_analysis(example_file, output_dir = tempdir())
}