Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 20, 2024
1 parent 0caa7b9 commit b377c96
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions R/format_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ format_parameters.parameters_model <- function(model, ...) {

# save some time, if model info is passed as argument
dot_args <- list(...)
if (!is.null(dot_args$model_info)) {
info <- dot_args$model_info
} else {
if (is.null(dot_args$model_info)) {
info <- insight::model_info(model, verbose = FALSE)
} else {
info <- dot_args$model_info
}

## TODO remove is.list() when insight 0.8.3 on CRAN
Expand Down Expand Up @@ -299,16 +299,16 @@ format_parameters.parameters_model <- function(model, ...) {
if (type == "interaction") {
components <- paste0(
"(",
paste0(utils::head(components, -1), collapse = sep),
paste(utils::head(components, -1), collapse = sep),
")",
sep,
utils::tail(components, 1)
)
} else {
components <- paste0(components, collapse = sep)
components <- paste(components, collapse = sep)
}
} else {
components <- paste0(components, collapse = sep)
components <- paste(components, collapse = sep)
}
components
}
Expand Down Expand Up @@ -438,7 +438,7 @@ format_parameters.parameters_model <- function(model, ...) {
# extract single coefficient names from interaction term
out <- unlist(strsplit(i, ":", fixed = TRUE))
# combine labels
labs <- c(labs, paste0(sapply(out, function(l) pretty_labels[l]), collapse = " * "))
labs <- c(labs, paste(sapply(out, function(l) pretty_labels[l]), collapse = " * "))
}
# add interaction terms to labels string
names(labs) <- names(interactions)
Expand Down Expand Up @@ -467,10 +467,10 @@ format_parameters.parameters_model <- function(model, ...) {
win_os <- tryCatch(
{
si <- Sys.info()
if (!is.null(si["sysname"])) {
si["sysname"] == "Windows" || startsWith(R.version$os, "mingw")
} else {
if (is.null(si["sysname"])) {
FALSE
} else {
si["sysname"] == "Windows" || startsWith(R.version$os, "mingw")
}
},
error = function(e) {
Expand Down

0 comments on commit b377c96

Please sign in to comment.