jmgirard / circumplex

@@ -156,13 +156,15 @@
Loading
156 156
157 157
ssm_plot_contrast <- function(.ssm_object, axislabel = "Difference",
158 158
                              xy = TRUE, color = "red", linesize = 1.25, fontsize = 12) {
159 -
  param_names <- c(
160 -
    e = "\u0394 Elevation",
161 -
    x = "\u0394 X-Value",
162 -
    y = "\u0394 Y-Value",
163 -
    a = "\u0394 Amplitude",
164 -
    d = "\u0394 Displacement"
159 +
  plabs <- c(
160 +
    e = expression(paste(Delta, " Elevation")),
161 +
    x = expression(paste(Delta, " X-Value")),
162 +
    y = expression(paste(Delta, " Y-Value")),
163 +
    a = expression(paste(Delta, " Amplitude")),
164 +
    d = expression(paste(Delta, " Displacement"))
165 165
  )
166 +
  
167 +
  pvals <- c("e", "x", "y", "a", "d")
166 168
167 169
  res <- .ssm_object$results
168 170
@@ -171,7 +173,8 @@
Loading
171 173
      res,
172 174
      -c(x_est, x_lci, x_uci, y_est, y_lci, y_uci)
173 175
    )
174 -
    param_names <- param_names[-c(2, 3)]
176 +
    plabs <- plabs[-c(2, 3)]
177 +
    pvals <- pvals[-c(2, 3)]
175 178
  }
176 179
177 180
  # TODO: Check that these ifelse() statements are correct
@@ -188,7 +191,7 @@
Loading
188 191
    tidyr::extract(col = key, into = c("Parameter", "Type"), "(.)_(...)") %>% 
189 192
    tidyr::pivot_wider(names_from = Type, values_from = value) %>% 
190 193
    dplyr::rename(Difference = est, Contrast = label) %>%
191 -
    dplyr::mutate(Parameter = factor(Parameter, levels = c("e", "x", "y", "a", "d")))
194 +
    dplyr::mutate(Parameter = factor(Parameter, levels = pvals, labels = plabs))
192 195
  
193 196
  p <- 
194 197
    res %>% 
@@ -211,7 +214,7 @@
Loading
211 214
    ggplot2::labs(y = axislabel) +
212 215
    ggplot2::facet_wrap(~Parameter,
213 216
      nrow = 1, scales = "free",
214 -
      labeller = ggplot2::as_labeller(param_names)
217 +
      labeller = ggplot2::label_parsed
215 218
    )
216 219
217 220
  p
Files Coverage
R 87.92%
src 100.00%
Project Totals (11 files) 89.75%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
        informational: true
10
    patch:
11
      default:
12
        target: auto
13
        threshold: 1%
14
        informational: true
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading