Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 14, 2023
1 parent dde7686 commit a4cabd8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
34 changes: 17 additions & 17 deletions R/check_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -192,23 +192,23 @@ check_distribution.numeric <- function(model) {
x <- x[!is.na(x)]

data.frame(
"SD" = stats::sd(x),
"MAD" = stats::mad(x, constant = 1),
"Mean_Median_Distance" = mean(x) - stats::median(x),
"Mean_Mode_Distance" = mean(x) - as.numeric(bayestestR::map_estimate(x, bw = "nrd0")),
"SD_MAD_Distance" = stats::sd(x) - stats::mad(x, constant = 1),
"Var_Mean_Distance" = stats::var(x) - mean(x),
"Range_SD" = diff(range(x)) / stats::sd(x),
"Range" = diff(range(x)),
"IQR" = stats::IQR(x),
"Skewness" = .skewness(x),
"Kurtosis" = .kurtosis(x),
"Uniques" = length(unique(x)) / length(x),
"N_Uniques" = length(unique(x)),
"Min" = min(x),
"Max" = max(x),
"Proportion_Positive" = sum(x >= 0) / length(x),
"Integer" = all(.is_integer(x))
SD = stats::sd(x),
MAD = stats::mad(x, constant = 1),
Mean_Median_Distance = mean(x) - stats::median(x),
Mean_Mode_Distance = mean(x) - as.numeric(bayestestR::map_estimate(x, bw = "nrd0")),
SD_MAD_Distance = stats::sd(x) - stats::mad(x, constant = 1),
Var_Mean_Distance = stats::var(x) - mean(x),
Range_SD = diff(range(x)) / stats::sd(x),
Range = diff(range(x)),
IQR = stats::IQR(x),
Skewness = .skewness(x),
Kurtosis = .kurtosis(x),
Uniques = length(unique(x)) / length(x),
N_Uniques = length(unique(x)),
Min = min(x),
Max = max(x),
Proportion_Positive = sum(x >= 0) / length(x),
Integer = all(.is_integer(x))
)
}

Expand Down
4 changes: 2 additions & 2 deletions R/icc.R
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ variance_decomposition <- function(model,
result <- structure(
class = "icc_decomposed",
list(
"ICC_decomposed" = 1 - fun(var_icc),
"ICC_CI" = ci_icc
ICC_decomposed = 1 - fun(var_icc),
ICC_CI = ci_icc
)
)

Expand Down
2 changes: 1 addition & 1 deletion R/model_performance.bayesian.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ model_performance.BFBayesFactor <- function(model,
out <- list()
attri <- list()

if ("R2" %in% c(metrics)) {
if ("R2" %in% metrics) {
r2 <- r2_bayes(model, average = average, prior_odds = prior_odds, verbose = verbose)
attri$r2_bayes <- attributes(r2) # save attributes

Expand Down

0 comments on commit a4cabd8

Please sign in to comment.