From 462e8aef4757f628a154c2752ac914b2f7d1be06 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 24 Sep 2023 18:59:59 +0200 Subject: [PATCH] docs --- R/check_outliers.R | 8 +++----- man/check_outliers.Rd | 7 +++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/R/check_outliers.R b/R/check_outliers.R index 519ab64e0..e98e037c0 100644 --- a/R/check_outliers.R +++ b/R/check_outliers.R @@ -301,6 +301,7 @@ #' group_iris <- datawizard::data_group(iris, "Species") #' check_outliers(group_iris) #' +#' @examplesIf require("see") && require("bigutilsr") && require("loo") && require("MASS") && require("ICSOutlier") && require("ICS") && require("dbscan") #' \donttest{ #' # You can also run all the methods #' check_outliers(data, method = "all") @@ -317,10 +318,7 @@ #' model <- lm(disp ~ mpg + hp, data = mt2) #' #' outliers_list <- check_outliers(model) -#' -#' if (require("see")) { -#' plot(outliers_list) -#' } +#' plot(outliers_list) #' #' insight::get_data(model)[outliers_list, ] # Show outliers data #' } @@ -508,7 +506,7 @@ check_outliers.default <- function(x, num.df <- outlier_count$all[!names(outlier_count$all) %in% c("Row", ID)] if (isTRUE(nrow(num.df) > 0)) { - num.df <- datawizard::change_code( + num.df <- datawizard::recode_values( num.df, recode = list(`2` = "(Multivariate)") ) diff --git a/man/check_outliers.Rd b/man/check_outliers.Rd index bb95fadf8..c19d4ecb0 100644 --- a/man/check_outliers.Rd +++ b/man/check_outliers.Rd @@ -292,6 +292,7 @@ filtered_data <- data[outliers_info$Outlier < 0.1, ] group_iris <- datawizard::data_group(iris, "Species") check_outliers(group_iris) +\dontshow{if (require("see") && require("bigutilsr") && require("loo") && require("MASS") && require("ICSOutlier") && require("ICS") && require("dbscan")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \donttest{ # You can also run all the methods check_outliers(data, method = "all") @@ -308,13 +309,11 @@ mt2 <- rbind(mt1, data.frame( model <- lm(disp ~ mpg + hp, data = mt2) outliers_list <- check_outliers(model) - -if (require("see")) { - plot(outliers_list) -} +plot(outliers_list) insight::get_data(model)[outliers_list, ] # Show outliers data } +\dontshow{\}) # examplesIf} } \references{ \itemize{