Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 22, 2024
1 parent d874d74 commit cf46aff
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions R/3_p_value.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,23 +169,22 @@ p_value.default <- function(model,
if (ncol(cs) >= 4) {
# do we have a p-value column based on t?
pvcn <- which(colnames(cs) == "Pr(>|t|)")

# if not, do we have a p-value column based on z?
if (length(pvcn) == 0) {
pvcn <- which(colnames(cs) == "Pr(>|z|)")
}

# if not, default to 4
if (length(pvcn) == 0) pvcn <- 4

if (length(pvcn) == 0) {
pvcn <- 4
}
p <- cs[, pvcn]

if (is.null(names(p))) {
coef_names <- rownames(cs)
if (length(coef_names) == length(p)) names(p) <- coef_names
if (length(coef_names) == length(p)) {
names(p) <- coef_names
}
}
}

names(p) <- .remove_backticks_from_string(names(p))
p
}

0 comments on commit cf46aff

Please sign in to comment.