Ordering values independently in facet_wrap()

Dear all,

I would like to order the difference values in my data from small to large inside facet_wrap() where each panel has its own distinct order.

Here is my code so far:

  
  all_var_apx  %>% 
ggplot(aes(x = fct_reorder(test_group, (difference)), y = difference, ymin = bca_ci_low, ymax = bca_ci_high, color=Voicing)) + 
  geom_linerange() + 
  geom_pointrange() +   geom_hline(yintercept = 0, color="red") + theme_classic() + facet_wrap(~var)


And this is the plot it generates. But as you can see the variables in the x-axis are not ordered from the absolute small value to the absolute large value. Can anybody help with this?

structure(list(test_group = c("h", "f", "z", "h", "s", "<U+0283>", 
"x", "<U+0281>", "ð", "<U+03B8>", "<U+0281>", "z", "ð", "h", 
"h", "<U+03B8>", "f", "x", "<U+0283>", "s", "s", "<U+0283>", 
"x", "<U+03B8>", "f", "h", "ð", "z", "<U+0281>", "h"), difference = c(0.272691564814319, 
0.339931546656402, 0.345996113077329, 0.354535171324727, 0.362621169240718, 
0.367580705327884, 0.5754295620242, 0.613440561574917, 0.646192417770898, 
0.776138550758279, -0.0645623054734185, 0.082531132154056, 0.102864717559747, 
0.190600313191994, 0.417716450084091, 0.536223093807613, 0.555075763700829, 
0.64273792090886, 0.759383477065518, 0.765388832447911, -3.84763253425232, 
-3.34528528281513, -2.87543239150845, -2.34264963208893, -2.22040363947979, 
-2.10496258366143, -0.418858000905252, -0.358339808304275, -0.343672706878961, 
0.00252449573965998), bca_ci_low = c(0.112455747226839, 0.188335588495741, 
0.191200575194077, 0.198773843491607, 0.214503814253224, 0.218609323460334, 
0.415618428377502, 0.452921016355907, 0.488342826235787, 0.610328958916321, 
-0.244606050086718, -0.0970408020409381, -0.0820052841470037, 
0.00573409308324146, 0.225425159762901, 0.323924429626786, 0.347832261872867, 
0.435785367456719, 0.544815140054194, 0.55688103033135, -4.44986472394159, 
-3.80417839820399, -3.21011745721127, -2.62319542702839, -2.48041125128384, 
-2.35503330627727, -0.546897194258833, -0.489328481435092, -0.472930247192843, 
-0.152257482905314), bca_ci_high = c(0.43024234461714, 0.486239940911359, 
0.493605391534663, 0.49937323094591, 0.505526460420473, 0.5211742300352, 
0.725430619337547, 0.76585592921834, 0.799160524200348, 0.925224604110868, 
0.119328545887156, 0.267715365976688, 0.28271403914918, 0.376619493617134, 
0.615076649272382, 0.741817147277846, 0.758730776718758, 0.82947433902177, 
0.960811509289517, 0.972557228613845, -3.28491296872177, -2.89427154950001, 
-2.54733248007305, -2.06981566188459, -1.95046918808833, -1.83259017408631, 
-0.284514289520204, -0.221035064316569, -0.207041695710978, 0.164168014972509
), Voicing = c("voiceless", "voiceless", "voiced", "voiced", 
"voiceless", "voiceless", "voiceless", "voiced", "voiced", "voiceless", 
"voiced", "voiced", "voiced", "voiceless", "voiced", "voiceless", 
"voiceless", "voiceless", "voiceless", "voiceless", "voiceless", 
"voiceless", "voiceless", "voiceless", "voiceless", "voiced", 
"voiced", "voiced", "voiced", "voiceless"), var = c("Vowel Duration", 
"Vowel Duration", "Vowel Duration", "Vowel Duration", "Vowel Duration", 
"Vowel Duration", "Vowel Duration", "Vowel Duration", "Vowel Duration", 
"Vowel Duration", "F0 onset", "F0 onset", "F0 onset", "F0 onset", 
"F0 onset", "F0 onset", "F0 onset", "F0 onset", "F0 onset", "F0 onset", 
"Voicing%", "Voicing%", "Voicing%", "Voicing%", "Voicing%", "Voicing%", 
"Voicing%", "Voicing%", "Voicing%", "Voicing%")), class = c("grouped_df", 
"tbl_df", "tbl", "data.frame"), row.names = c(NA, -30L), groups = structure(list(
    test_group = c("<U+0281>", "<U+0283>", "<U+03B8>", "ð", "f", 
    "h", "h", "s", "x", "z"), .rows = structure(list(c(8L, 11L, 
    29L), c(6L, 19L, 22L), c(10L, 16L, 24L), c(9L, 13L, 27L), 
        c(2L, 17L, 25L), c(1L, 14L, 30L), c(4L, 15L, 26L), c(5L, 
        20L, 21L), c(7L, 18L, 23L), c(3L, 12L, 28L)), ptype = integer(0), class = c("vctrs_list_of", 
    "vctrs_vctr", "list"))), class = c("tbl_df", "tbl", "data.frame"
), row.names = c(NA, -10L), .drop = TRUE))


This can be achieved with a hacky/clever unicode trick. where you use differing numbers of an invisible unicode space to make otherwise similar appearing factor levels differentiated;
important also to uses scales free_x on the wrap, the drop behaviour is default but I made it explicit.

all_var_apx <- structure(list(test_group = c(
  "h", "f", "z", "h", "s", "<U+0283>",
  "x", "<U+0281>", "ð", "<U+03B8>", "<U+0281>", "z", "ð", "h",
  "h", "<U+03B8>", "f", "x", "<U+0283>", "s", "s", "<U+0283>",
  "x", "<U+03B8>", "f", "h", "ð", "z", "<U+0281>", "h"
), difference = c(
  0.272691564814319,
  0.339931546656402, 0.345996113077329, 0.354535171324727, 0.362621169240718,
  0.367580705327884, 0.5754295620242, 0.613440561574917, 0.646192417770898,
  0.776138550758279, -0.0645623054734185, 0.082531132154056, 0.102864717559747,
  0.190600313191994, 0.417716450084091, 0.536223093807613, 0.555075763700829,
  0.64273792090886, 0.759383477065518, 0.765388832447911, -3.84763253425232,
  -3.34528528281513, -2.87543239150845, -2.34264963208893, -2.22040363947979,
  -2.10496258366143, -0.418858000905252, -0.358339808304275, -0.343672706878961,
  0.00252449573965998
), bca_ci_low = c(
  0.112455747226839, 0.188335588495741,
  0.191200575194077, 0.198773843491607, 0.214503814253224, 0.218609323460334,
  0.415618428377502, 0.452921016355907, 0.488342826235787, 0.610328958916321,
  -0.244606050086718, -0.0970408020409381, -0.0820052841470037,
  0.00573409308324146, 0.225425159762901, 0.323924429626786, 0.347832261872867,
  0.435785367456719, 0.544815140054194, 0.55688103033135, -4.44986472394159,
  -3.80417839820399, -3.21011745721127, -2.62319542702839, -2.48041125128384,
  -2.35503330627727, -0.546897194258833, -0.489328481435092, -0.472930247192843,
  -0.152257482905314
), bca_ci_high = c(
  0.43024234461714, 0.486239940911359,
  0.493605391534663, 0.49937323094591, 0.505526460420473, 0.5211742300352,
  0.725430619337547, 0.76585592921834, 0.799160524200348, 0.925224604110868,
  0.119328545887156, 0.267715365976688, 0.28271403914918, 0.376619493617134,
  0.615076649272382, 0.741817147277846, 0.758730776718758, 0.82947433902177,
  0.960811509289517, 0.972557228613845, -3.28491296872177, -2.89427154950001,
  -2.54733248007305, -2.06981566188459, -1.95046918808833, -1.83259017408631,
  -0.284514289520204, -0.221035064316569, -0.207041695710978, 0.164168014972509
), Voicing = c(
  "voiceless", "voiceless", "voiced", "voiced",
  "voiceless", "voiceless", "voiceless", "voiced", "voiced", "voiceless",
  "voiced", "voiced", "voiced", "voiceless", "voiced", "voiceless",
  "voiceless", "voiceless", "voiceless", "voiceless", "voiceless",
  "voiceless", "voiceless", "voiceless", "voiceless", "voiced",
  "voiced", "voiced", "voiced", "voiceless"
), var = c(
  "Vowel Duration",
  "Vowel Duration", "Vowel Duration", "Vowel Duration", "Vowel Duration",
  "Vowel Duration", "Vowel Duration", "Vowel Duration", "Vowel Duration",
  "Vowel Duration", "F0 onset", "F0 onset", "F0 onset", "F0 onset",
  "F0 onset", "F0 onset", "F0 onset", "F0 onset", "F0 onset", "F0 onset",
  "Voicing%", "Voicing%", "Voicing%", "Voicing%", "Voicing%", "Voicing%",
  "Voicing%", "Voicing%", "Voicing%", "Voicing%"
)), class = c(
  "grouped_df",
  "tbl_df", "tbl", "data.frame"
), row.names = c(NA, -30L), groups = structure(list(
  test_group = c(
    "<U+0281>", "<U+0283>", "<U+03B8>", "ð", "f",
    "h", "h", "s", "x", "z"
  ), .rows = structure(list(
    c(
      8L, 11L,
      29L
    ), c(6L, 19L, 22L), c(10L, 16L, 24L), c(9L, 13L, 27L),
    c(2L, 17L, 25L), c(1L, 14L, 30L), c(4L, 15L, 26L), c(
      5L,
      20L, 21L
    ), c(7L, 18L, 23L), c(3L, 12L, 28L)
  ), ptype = integer(0), class = c(
    "vctrs_list_of",
    "vctrs_vctr", "list"
  ))
), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -10L), .drop = TRUE))


# changing the Unicode codepoints to their symbolic representations for
# pretty printing purposes
convert_codepoint <- function(text) {
  t1 <- gsub("<U\\+([0-9A-F]{4})>", "\\\\u\\1", text)
  t2 <- paste0("'", t1, "'")
  eval(parse(text = t2))
}
convert_codepoint(txt)

convert_codepoints <- Vectorize(convert_codepoint)

all_var_apx$test_group <- convert_codepoints(all_var_apx$test_group)
(all_var_apx2 <- all_var_apx |>
  mutate(v2 = str_replace_all(
    string = paste0("x_", make.names(var)),
    pattern = fixed("."),
    replacement = ""
  )) |> split(~v2) |>
  imap(\(x, y) mutate(
    x,
    {{ y }} := fct_reorder(
      test_group,
      (difference)
    )
  )))
# use a unicode for invisible space to pad the factor level names for
# otherwise similar factor names that need their own ordering
invisible_space <- "\U200B"

all_var_apx3 <- all_var_apx2 |>
  bind_rows() |>
  ungroup() |>
  arrange(
    v2,
    desc(difference)
  ) |>
  mutate(rn = row_number()) |>
  rowwise() |>
  mutate(
    test_group = paste0(
      test_group,
      paste0(rep(
        x = invisible_space,
        times = rn
      ), collapse = "")
    )
  ) |>
  ungroup() |>
  mutate(test_group = forcats::as_factor(test_group))

all_var_apx3 |>
  ggplot(aes(
    x = test_group,
    y = difference,
    ymin = bca_ci_low,
    ymax = bca_ci_high,
    color = Voicing
  )) +
  geom_linerange() +
  geom_pointrange() +
  geom_hline(yintercept = 0, color = "red") +
  theme_classic() +
  facet_wrap(~var, drop = TRUE, scales = "free_x")


image

1 Like

Thanks for this @nirgrahamuk!

The code is not working at my end not sure why, but when I run this chunk:


all_var_apx$test_group <- convert_codepoints(all_var_apx$test_group)
(all_var_apx2 <- all_var_apx %>% 
    mutate(v2 = str_replace_all(
      string = paste0("x_", make.names(var)),
      pattern = fixed("."),
      replacement = ""
    )) %>%  split(~v2) %>% 
    imap(\(x, y) mutate(
      x,
      {{ y }} := fct_reorder(
        test_group,
        (difference)
      )
    )))

I got this error:

Error: unexpected input in:
"    )) %>%  split(~v2) %>% 
    imap(\"
>       x,
Error: unexpected ',' in "      x,"
>       {{ y }} := fct_reorder(
+         test_group,
+         (difference)
+       )
Error in `:=`({ : could not find function ":="
>     )))
Error: unexpected ')' in "    )"

I tested the code I shared in a new R session.

  1. it needs library(tidyverse) adding at the top
  2. it had a line left in from my own testing thats not needed and would error but not effect the progress of the code; the line is convert_codepoint(txt)

this is a function in the rlang package of tidyverse, so loading the tidyverse should address this.

This is very strange. It is still not working and there must be something going wrong at my end that I don't see it yet.

This is my session info, also I tried to use a new R session and restart R a few times but no success.

> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] forcats_0.5.2   stringr_1.4.0   dplyr_1.0.10    purrr_0.3.4     readr_2.1.3     tidyr_1.2.1     tibble_3.1.8    ggplot2_3.3.6   tidyverse_1.3.2

loaded via a namespace (and not attached):
  [1] TH.data_1.1-0        googledrive_2.0.0    minqa_1.2.4          colorspace_1.4-1     ellipsis_0.3.2       modeltools_0.2-23    ggridges_0.5.3      
  [8] markdown_1.1         base64enc_0.1-3      fs_1.5.2             rstudioapi_0.14      rstan_2.21.7         DT_0.25              fansi_0.4.1         
 [15] mvtnorm_1.1-3        lubridate_1.8.0      xml2_1.3.3           diffobj_0.3.5        coin_1.4-2           codetools_0.2-18     splines_4.0.5       
 [22] libcoin_1.0-9        shinythemes_1.2.0    bayesplot_1.9.0      jsonlite_1.8.2       nloptr_1.2.2.2       broom_1.0.1          dbplyr_2.2.1        
 [29] shiny_1.7.2          httr_1.4.2           compiler_4.0.5       backports_1.1.10     assertthat_0.2.1     Matrix_1.3-3         fastmap_1.1.0       
 [36] gargle_1.2.0         strucchange_1.5-2    cli_3.4.0            later_1.3.0          htmltools_0.5.3      prettyunits_1.1.1    tools_4.0.5         
 [43] igraph_1.2.11        gtable_0.3.0         glue_1.4.2           reshape2_1.4.4       Rcpp_1.0.9           cellranger_1.1.0     vctrs_0.4.1         
 [50] nlme_3.1-155         crosstalk_1.2.0      ps_1.4.0             rvest_1.0.3          lme4_1.1-25          mime_0.9             miniUI_0.1.1.1      
 [57] lifecycle_1.0.2      gtools_3.9.3         statmod_1.4.35       googlesheets4_1.0.0  MASS_7.3-55          zoo_1.8-10           scales_1.1.1        
 [64] rstanarm_2.21.1      colourpicker_1.1.1   hms_1.1.2            promises_1.2.0.1     parallel_4.0.5       sandwich_3.0-1       inline_0.3.19       
 [71] shinystan_2.6.0      gridExtra_2.3        loo_2.5.1            StanHeaders_2.21.0-7 stringi_1.5.3        dygraphs_1.1.1.6     boot_1.3-28         
 [78] pkgbuild_1.3.1       rlang_1.0.5          pkgconfig_2.0.3      matrixStats_0.62.0   lattice_0.20-44      rstantools_2.2.0     htmlwidgets_1.5.4   
 [85] cowplot_1.1.1        processx_3.8.0       tidyselect_1.2.0     plyr_1.8.7           magrittr_2.0.3       R6_2.5.0             generics_0.0.2      
 [92] multcomp_1.4-18      DBI_1.1.0            withr_2.5.0          pillar_1.8.1         haven_2.5.1          xts_0.12.1           survival_3.3-1      
 [99] modelr_0.1.8         crayon_1.5.2         utf8_1.1.4           party_1.3-9          tzdb_0.3.0           readxl_1.3.1         grid_4.0.5          
[106] callr_3.5.1          threejs_0.3.3        reprex_2.0.2         digest_0.6.27        xtable_1.8-4         httpuv_1.6.6         RcppParallel_5.1.5

More specifically, we Iran the chunk above I keep getting this error although tidyverse is loaded

>   (all_var_apx2 <- all_var_apx |>
Error: unexpected '>' in "  (all_var_apx2 <- all_var_apx30 |>"
>       mutate(v2 = str_replace_all(
+         string = paste0("x_", make.names(var)),
+         pattern = fixed("."),
+         replacement = ""
+       )) |> split(~v2) |>
Error: unexpected '>' in:
"        replacement = ""
      )) |>"
>       imap(\(x, y) mutate(
Error: unexpected input in "      imap(\"
>         x,
Error: unexpected ',' in "        x,"
>         {{ y }} := fct_reorder(
+           test_group,
+           (difference)
+         )
Error in `:=`({ : could not find function ":="
>       )))
Error: unexpected ')' in "      )"

I use the modern R pipe |> if you cant upgrade to R 4.2 etc then change it everywhere for magrittr pipe %>%

I just changed it and here is the output.

>   (all_var_apx2 <- all_var_apx %>% 
+       mutate(v2 = str_replace_all(
+         string = paste0("x_", make.names(var)),
+         pattern = fixed("."),
+         replacement = ""
+       )) %>%  split(~v2) %>% 
+       imap(\(x, y) mutate(
Error: unexpected input in:
"      )) %>%  split(~v2) %>% 
      imap(\"
>         x,
Error: unexpected ',' in "        x,"
>         {{ y }} := fct_reorder(
+           test_group,
+           (difference)
+         )
Error in `:=`({ : could not find function ":="
>       )))
Error: unexpected ')' in "      )"

I suppose this reveals I use a lot of 'new' language features...
2 things;

  1. I used modern syntax for split, that may have confused your code. youll see it called differently (more ugly) below
  2. I used modern syntax for anonymous functions, to make the code more back compatible I've gone back to using ~{.x , .y} etc. which is no longer best practice.

Try this :

library(tidyverse)
all_var_apx <- structure(list(test_group = c(
  "h", "f", "z", "h", "s", "<U+0283>",
  "x", "<U+0281>", "ð", "<U+03B8>", "<U+0281>", "z", "ð", "h",
  "h", "<U+03B8>", "f", "x", "<U+0283>", "s", "s", "<U+0283>",
  "x", "<U+03B8>", "f", "h", "ð", "z", "<U+0281>", "h"
), difference = c(
  0.272691564814319,
  0.339931546656402, 0.345996113077329, 0.354535171324727, 0.362621169240718,
  0.367580705327884, 0.5754295620242, 0.613440561574917, 0.646192417770898,
  0.776138550758279, -0.0645623054734185, 0.082531132154056, 0.102864717559747,
  0.190600313191994, 0.417716450084091, 0.536223093807613, 0.555075763700829,
  0.64273792090886, 0.759383477065518, 0.765388832447911, -3.84763253425232,
  -3.34528528281513, -2.87543239150845, -2.34264963208893, -2.22040363947979,
  -2.10496258366143, -0.418858000905252, -0.358339808304275, -0.343672706878961,
  0.00252449573965998
), bca_ci_low = c(
  0.112455747226839, 0.188335588495741,
  0.191200575194077, 0.198773843491607, 0.214503814253224, 0.218609323460334,
  0.415618428377502, 0.452921016355907, 0.488342826235787, 0.610328958916321,
  -0.244606050086718, -0.0970408020409381, -0.0820052841470037,
  0.00573409308324146, 0.225425159762901, 0.323924429626786, 0.347832261872867,
  0.435785367456719, 0.544815140054194, 0.55688103033135, -4.44986472394159,
  -3.80417839820399, -3.21011745721127, -2.62319542702839, -2.48041125128384,
  -2.35503330627727, -0.546897194258833, -0.489328481435092, -0.472930247192843,
  -0.152257482905314
), bca_ci_high = c(
  0.43024234461714, 0.486239940911359,
  0.493605391534663, 0.49937323094591, 0.505526460420473, 0.5211742300352,
  0.725430619337547, 0.76585592921834, 0.799160524200348, 0.925224604110868,
  0.119328545887156, 0.267715365976688, 0.28271403914918, 0.376619493617134,
  0.615076649272382, 0.741817147277846, 0.758730776718758, 0.82947433902177,
  0.960811509289517, 0.972557228613845, -3.28491296872177, -2.89427154950001,
  -2.54733248007305, -2.06981566188459, -1.95046918808833, -1.83259017408631,
  -0.284514289520204, -0.221035064316569, -0.207041695710978, 0.164168014972509
), Voicing = c(
  "voiceless", "voiceless", "voiced", "voiced",
  "voiceless", "voiceless", "voiceless", "voiced", "voiced", "voiceless",
  "voiced", "voiced", "voiced", "voiceless", "voiced", "voiceless",
  "voiceless", "voiceless", "voiceless", "voiceless", "voiceless",
  "voiceless", "voiceless", "voiceless", "voiceless", "voiced",
  "voiced", "voiced", "voiced", "voiceless"
), var = c(
  "Vowel Duration",
  "Vowel Duration", "Vowel Duration", "Vowel Duration", "Vowel Duration",
  "Vowel Duration", "Vowel Duration", "Vowel Duration", "Vowel Duration",
  "Vowel Duration", "F0 onset", "F0 onset", "F0 onset", "F0 onset",
  "F0 onset", "F0 onset", "F0 onset", "F0 onset", "F0 onset", "F0 onset",
  "Voicing%", "Voicing%", "Voicing%", "Voicing%", "Voicing%", "Voicing%",
  "Voicing%", "Voicing%", "Voicing%", "Voicing%"
)), class = c(
  "grouped_df",
  "tbl_df", "tbl", "data.frame"
), row.names = c(NA, -30L), groups = structure(list(
  test_group = c(
    "<U+0281>", "<U+0283>", "<U+03B8>", "ð", "f",
    "h", "h", "s", "x", "z"
  ), .rows = structure(list(
    c(
      8L, 11L,
      29L
    ), c(6L, 19L, 22L), c(10L, 16L, 24L), c(9L, 13L, 27L),
    c(2L, 17L, 25L), c(1L, 14L, 30L), c(4L, 15L, 26L), c(
      5L,
      20L, 21L
    ), c(7L, 18L, 23L), c(3L, 12L, 28L)
  ), ptype = integer(0), class = c(
    "vctrs_list_of",
    "vctrs_vctr", "list"
  ))
), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -10L), .drop = TRUE))


# changing the Unicode codepoints to their symbolic representations for
# pretty printing purposes
convert_codepoint <- function(text) {
  t1 <- gsub("<U\\+([0-9A-F]{4})>", "\\\\u\\1", text)
  t2 <- paste0("'", t1, "'")
  eval(parse(text = t2))
}


convert_codepoints <- Vectorize(convert_codepoint)

all_var_apx$test_group <- convert_codepoints(all_var_apx$test_group)

another_step <- all_var_apx %>%
  mutate(v2 = str_replace_all(
    string = paste0("x_", make.names(var)),
    pattern = fixed("."),
    replacement = ""
  ))
another_step_2 <- split(another_step,factor(another_step$v2))
(all_var_apx2 <- another_step_2 %>%
    imap(~ {
    mutate(
      .x,
      {{ .y }} := fct_reorder(
        test_group,
        (difference)
      )
    )}))
# use a unicode for invisible space to pad the factor level names for
# otherwise similar factor names that need their own ordering
invisible_space <- "\U200B"

all_var_apx3 <- all_var_apx2 %>%
  bind_rows() %>%
  ungroup() %>%
  arrange(
    v2,
    desc(difference)
  ) %>%
  mutate(rn = row_number()) %>%
  rowwise() %>%
  mutate(
    test_group = paste0(
      test_group,
      paste0(rep(
        x = invisible_space,
        times = rn
      ), collapse = "")
    )
  ) %>%
  ungroup() %>%
  mutate(test_group = forcats::as_factor(test_group))

all_var_apx3 %>%
  ggplot(aes(
    x = test_group,
    y = difference,
    ymin = bca_ci_low,
    ymax = bca_ci_high,
    color = Voicing
  )) +
  geom_linerange() +
  geom_pointrange() +
  geom_hline(yintercept = 0, color = "red") +
  theme_classic() +
  facet_wrap(~var, drop = TRUE, scales = "free_x")
1 Like

Thank you so much @nirgrahamuk for taking the time to help!

Brilliant!! I worked now.

You're welcome; thanks for the interesting question.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.