Closed cocoaawil closed 2 weeks ago
Hello! I looked into this issue and you are right: This package seems to have stopped working due to some changes in ggplot2 that occured in the past 1-2 years. I was able to run the code by downgrading both R and the ggplot2 package to 2022 versions, and all went well.
That said, obviously downgrading R isn't a real solution, so I looked into fixing the actual code. However, while looking at it, I cam across another package, ggh4x, which provides a much cleaner solution to this problem. Assuming you recreate p1
using the example code, you can generate a plot essentially like p2
using the following:
library("ggh4x")
p3 <- p1 + facet_nested(~ am + vs + gear, scales = TRUE, space = TRUE)
ggsave("p3.png", width = 20, height = 5)
This code will produce the following output, which compares favorably with p2
shown on the home page of this repo:
@cocoaawil: Could you give this a try? If this works for you, I'll archive this repo and forward people over to ggh4x.
@cocoaawil: Could you give this a try? If this works for you, I'll archive this repo and forward people over to ggh4x.
Thank you very much. It works. I got the figure same as p2.png. How can I cite your R library?
You're very welcome @cocoaawil! Given that my package no longer really works, you're very kind, but there's no reason to cite my package at this point. Instead, please go ahead and cite ggh4x using the details provided here: https://teunbrand.github.io/ggh4x/authors.html#citation
Just in case you did need a citation to this repo for some specific reason, I created a Zenodo release here that could be used: https://doi.org/10.5281/zenodo.12706857
Lastly, I'm going to go ahead and archive this repo and redirect people to ggh4x as noted in the prior comment.
Thanks again for bringing this to my attention!
Dear Sir, I'm interested in your R library. I tried to use the example from tutorial but p2.png can not change merged group in first header such as Automatic show in three repeat words. I'm not sure how to fix it. I'm looking forward to hearing from you. Thank you very much.