Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using function str on a patchwork object #217

Closed
zhangfeiran opened this issue Nov 19, 2020 · 2 comments
Closed

Error when using function str on a patchwork object #217

zhangfeiran opened this issue Nov 19, 2020 · 2 comments

Comments

@zhangfeiran
Copy link

After executing:

library(ggplot2)
library(patchwork)

p1 = ggplot(mtcars, aes(x = factor(cyl), y = mpg)) + geom_violin()
p2 = ggplot(mtcars, aes(x = factor(cyl), y = mpg)) + geom_boxplot()
p = p1 + p2
str(p, max.level = 1)

An error shows up:

List of 10
 $ data       :List of 9
  ..- attr(*, "class")= chr [1:2] "gg" "ggplot"
 $ layers     :List of 9
  ..- attr(*, "class")= chr [1:2] "gg" "ggplot"
 $ scales     :
Error: Index out of bounds
Traceback:

1. str(p, max.level = 1)
2. str.default(p, max.level = 1)
3. object[[i]]
4. `[[.patchwork`(object, i)
5. stop("Index out of bounds", call. = FALSE)

Is this some kind of a bug?

@thomasp85
Copy link
Owner

fixed now

thomasp85 added a commit that referenced this issue Dec 15, 2020
@zhangfeiran
Copy link
Author

Thank you, it works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants