|
11 | 11 | # remove them here and clean/prepare them in ".parameters_type_basic()". |
12 | 12 | # for formatting / printing, refer to ".format_parameter()". |
13 | 13 |
|
| 14 | + # fmt: skip |
14 | 15 | pattern <- if (full) { |
15 | 16 | c( |
16 | | - "as.factor", "as.numeric", "as.ordered", "factor", "ordered", "offset", |
17 | | - "lag", "diff", "catg", "matrx", "pol", "strata", "strat", "scale", |
| 17 | + "as.factor", "as.numeric", "as.ordered", "as.logical", "factor", "ordered", |
| 18 | + "offset", "lag", "diff", "catg", "matrx", "pol", "strata", "strat", "scale", |
18 | 19 | "scored", "interaction", "lsp", "pb", "lo", "t2", "te", "ti", "tt", "mi", |
19 | 20 | "mo", "gp" |
20 | 21 | ) |
21 | 22 | } else { |
22 | | - c("as.factor", "as.numeric", "as.ordered", "factor", "ordered", "catg", "interaction") |
| 23 | + c( |
| 24 | + "as.factor", "as.numeric", "as.ordered", "as.logical", "factor", "ordered", |
| 25 | + "catg", "interaction" |
| 26 | + ) |
23 | 27 | } |
24 | 28 |
|
25 | 29 | for (j in seq_along(pattern)) { |
|
31 | 35 | x <- insight::trim_ws(sub("offset\\(([^-+ )]*)\\)(.*)", "\\1\\2", x)) |
32 | 36 | # some exceptions here... |
33 | 37 | } else if (full && pattern[j] == "scale" && any(grepl("scale(", x, fixed = TRUE))) { |
34 | | - x[grepl("scale(", x, fixed = TRUE)] <- insight::clean_names(grep("scale(", x, fixed = TRUE, value = TRUE)) |
| 38 | + x[grepl("scale(", x, fixed = TRUE)] <- insight::clean_names(grep( |
| 39 | + "scale(", |
| 40 | + x, |
| 41 | + fixed = TRUE, |
| 42 | + value = TRUE |
| 43 | + )) |
35 | 44 | } else if (any(grepl(pattern[j], x, fixed = TRUE))) { |
36 | 45 | p <- paste0(pattern[j], "\\(((\\w|\\.)*)\\)(.*)") |
37 | 46 | x <- insight::trim_ws(sub(p, "\\1\\3", x)) |
38 | 47 | } |
39 | 48 | } |
40 | 49 |
|
| 50 | + # for logicals |
| 51 | + x <- gsub("TRUE$", "", x) |
| 52 | + |
41 | 53 | gsub("`", "", x, fixed = TRUE) |
42 | 54 | } |
43 | 55 |
|
|
0 commit comments