Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 25, 2023
1 parent 9835b52 commit 9d42fd7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions R/ci_profile_boot.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
)

param_names <- switch(component,
"conditional" = pars$Parameter,
"zi" = ,
"zero_inflated" = paste0("zi~", pars$Parameter),
conditional = pars$Parameter,
zi = ,
zero_inflated = paste0("zi~", pars$Parameter),
c(
pars$Parameter[pars$Component == "conditional"],
paste0("zi~", pars$Parameter[pars$Component == "zero_inflated"])
Expand Down
20 changes: 10 additions & 10 deletions R/format.R
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ format.compare_parameters <- function(x,
ran_pars <- which(x$Effects == "random")

# find all random effect groups
if (!is.null(x$Group)) {
ran_groups <- unique(insight::compact_character(x$Group))
ran_group_rows <- which(nchar(x$Group) > 0)
} else {
if (is.null(x$Group)) {
ran_groups <- NULL
ran_group_rows <- NULL
} else {
ran_groups <- unique(insight::compact_character(x$Group))
ran_group_rows <- which(nchar(x$Group) > 0)
}

for (i in models) {
Expand Down Expand Up @@ -646,10 +646,10 @@ format.parameters_sem <- function(x,
.add_footer_sigma <- function(footer = NULL, digits = 3, sigma = NULL, residual_df = NULL, type = "text") {
if (!is.null(sigma)) {
# format residual df
if (!is.null(residual_df)) {
res_df <- paste0(" (df = ", residual_df, ")")
} else {
if (is.null(residual_df)) {
res_df <- ""
} else {
res_df <- paste0(" (df = ", residual_df, ")")
}

if (type == "text" || type == "markdown") {
Expand Down Expand Up @@ -785,10 +785,10 @@ format.parameters_sem <- function(x,
.add_footer_formula <- function(footer = NULL, model_formula = NULL, n_obs = NULL, type = "text") {
if (!is.null(model_formula)) {
# format n of observations
if (!is.null(n_obs)) {
n <- paste0(" (", n_obs, " Observations)")
} else {
if (is.null(n_obs)) {
n <- ""
} else {
n <- paste0(" (", n_obs, " Observations)")
}

if (type == "text" || type == "markdown") {
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-complete_separation.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ skip_if(getRversion() < "4.0.0")
skip_if_not_installed("withr")

withr::with_options(
list("parameters_warning_exponentiate" = TRUE),
list(parameters_warning_exponentiate = TRUE),
{
test_that("print warning about complete separation", {
d_sep <- data.frame(
Expand All @@ -18,7 +18,7 @@ withr::with_options(
)

withr::with_options(
list("parameters_warning_exponentiate" = TRUE),
list(parameters_warning_exponentiate = TRUE),
{
test_that("print warning about complete separation", {
data(mtcars)
Expand All @@ -30,7 +30,7 @@ withr::with_options(
)

withr::with_options(
list("parameters_warning_exponentiate" = TRUE),
list(parameters_warning_exponentiate = TRUE),
{
test_that("print warning about quasi complete separation", {
data(mtcars)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-printing.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ skip_if_not_installed("withr")
skip_if(getRversion() < "4.0.0")

withr::with_options(
list("parameters_interaction" = "*"),
list(parameters_interaction = "*"),
{
# Splitting model components ----
test_that("print model with multiple components", {
Expand Down

0 comments on commit 9d42fd7

Please sign in to comment.