Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f2da2ad

Browse files
authoredApr 29, 2024··
Fixes bug in outlier plot method (#717)
1 parent c5eef11 commit f2da2ad

File tree

3 files changed

+31
-40
lines changed

3 files changed

+31
-40
lines changed
 

‎.gitignore

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,52 @@
11
# History files
22
.Rhistory
33
.Rapp.history
4-
54
# Session Data files
65
.RData
7-
86
# Example code in package build process
97
*-Ex.R
10-
118
# Output files from R CMD build
129
/*.tar.gz
13-
1410
# Output files from R CMD check
1511
/*.Rcheck/
1612
/revdep/
1713
revdep
18-
1914
# RStudio files
2015
.Rproj.user/
2116
*.Rproj
22-
2317
# produced vignettes
2418
vignettes/*.html
2519
vignettes/*.pdf
26-
2720
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
2821
.httr-oauth
29-
3022
# knitr and R markdown default cache directories
3123
/*_cache/
3224
/cache/
33-
3425
# Temporary files created by R markdown
3526
*.utf8.md
3627
*.knit.md
37-
3828
# Shiny token, see https://shiny.rstudio.com/articles/shinyapps.html
3929
rsconnect/
4030
inst/doc
41-
4231
=========================
4332
# Operating System Files
4433
# OSX
4534
.DS_Store
4635
.AppleDouble
4736
.LSOverride
48-
4937
# Thumbnails
5038
._*
51-
5239
# Files that might appear in the root of a volume
5340
.DocumentRevisions-V100
5441
.fseventsd
5542
.Spotlight-V100
5643
.TemporaryItems
5744
.Trashes
5845
.VolumeIcon.icns
59-
6046
# Directories potentially created on remote AFP share
6147
.AppleDB
6248
.AppleDesktop
6349
Network Trash Folder
6450
Temporary Items
65-
.apdisk
51+
.apdisk
52+
.Rprofile

‎R/check_outliers.R

+15-13
Original file line numberDiff line numberDiff line change
@@ -255,46 +255,47 @@
255255
#' @references
256256
#' - Archimbaud, A., Nordhausen, K., and Ruiz-Gazen, A. (2018). ICS for
257257
#' multivariate outlier detection with application to quality control.
258-
#' Computational Statistics and Data Analysis, 128, 184-199.
258+
#' *Computational Statistics and Data Analysis*, *128*, 184-199.
259259
#' \doi{10.1016/j.csda.2018.06.011}
260260
#'
261261
#' - Gnanadesikan, R., and Kettenring, J. R. (1972). Robust estimates, residuals,
262-
#' and outlier detection with multiresponse data. Biometrics, 81-124.
262+
#' and outlier detection with multiresponse data. *Biometrics*, 81-124.
263263
#'
264264
#' - Bollen, K. A., and Jackman, R. W. (1985). Regression diagnostics: An
265-
#' expository treatment of outliers and influential cases. Sociological Methods
266-
#' and Research, 13(4), 510-542.
265+
#' expository treatment of outliers and influential cases. *Sociological Methods
266+
#' and Research*, *13*(4), 510-542.
267267
#'
268268
#' - Cabana, E., Lillo, R. E., and Laniado, H. (2019). Multivariate outlier
269269
#' detection based on a robust Mahalanobis distance with shrinkage estimators.
270270
#' arXiv preprint arXiv:1904.02596.
271271
#'
272272
#' - Cook, R. D. (1977). Detection of influential observation in linear
273-
#' regression. Technometrics, 19(1), 15-18.
273+
#' regression. *Technometrics*, *19*(1), 15-18.
274274
#'
275275
#' - Iglewicz, B., and Hoaglin, D. C. (1993). How to detect and handle outliers
276276
#' (Vol. 16). Asq Press.
277277
#'
278278
#' - Leys, C., Klein, O., Dominicy, Y., and Ley, C. (2018). Detecting
279-
#' multivariate outliers: Use a robust variant of Mahalanobis distance. Journal
280-
#' of Experimental Social Psychology, 74, 150-156.
279+
#' multivariate outliers: Use a robust variant of Mahalanobis distance. *Journal
280+
#' of Experimental Social Psychology*, 74, 150-156.
281281
#'
282282
#' - Liu, F. T., Ting, K. M., and Zhou, Z. H. (2008, December). Isolation forest.
283283
#' In 2008 Eighth IEEE International Conference on Data Mining (pp. 413-422).
284284
#' IEEE.
285285
#'
286286
#' - Lüdecke, D., Ben-Shachar, M. S., Patil, I., Waggoner, P., and Makowski, D.
287287
#' (2021). performance: An R package for assessment, comparison and testing of
288-
#' statistical models. Journal of Open Source Software, 6(60), 3139.
288+
#' statistical models. *Journal of Open Source Software*, *6*(60), 3139.
289289
#' \doi{10.21105/joss.03139}
290290
#'
291291
#' - Thériault, R., Ben-Shachar, M. S., Patil, I., Lüdecke, D., Wiernik, B. M.,
292292
#' and Makowski, D. (2023). Check your outliers! An introduction to identifying
293-
#' statistical outliers in R with easystats. \doi{10.31234/osf.io/bu6nt}
293+
#' statistical outliers in R with easystats. *Behavior Research Methods*, 1-11.
294+
#' \doi{10.3758/s13428-024-02356-w}
294295
#'
295296
#' - Rousseeuw, P. J., and Van Zomeren, B. C. (1990). Unmasking multivariate
296-
#' outliers and leverage points. Journal of the American Statistical
297-
#' association, 85(411), 633-639.
297+
#' outliers and leverage points. *Journal of the American Statistical
298+
#' association*, *85*(411), 633-639.
298299
#'
299300
#' @examples
300301
#' data <- mtcars # Size nrow(data) = 32
@@ -331,8 +332,9 @@
331332
#' # We can run the function stratified by groups using `{datawizard}` package:
332333
#' group_iris <- datawizard::data_group(iris, "Species")
333334
#' check_outliers(group_iris)
334-
#'
335+
#' # nolint start
335336
#' @examplesIf require("see") && require("bigutilsr") && require("loo") && require("MASS") && require("ICSOutlier") && require("ICS") && require("dbscan")
337+
#' # nolint end
336338
#' \donttest{
337339
#' # You can also run all the methods
338340
#' check_outliers(data, method = "all", verbose = FALSE)
@@ -586,7 +588,7 @@ check_outliers.default <- function(x,
586588
attr(outlier, "threshold") <- thresholds
587589
attr(outlier, "method") <- method
588590
attr(outlier, "text_size") <- 3
589-
attr(outlier, "influential_obs") <- .influential_obs(x)
591+
attr(outlier, "influential_obs") <- .influential_obs(x, threshold = unlist(thresholds))
590592
attr(outlier, "variables") <- "(Whole model)"
591593
attr(outlier, "raw_data") <- my_data
592594
attr(outlier, "outlier_var") <- outlier_var

‎man/check_outliers.Rd

+14-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.