Skip to content
This repository

facet_wrap needs labeller parameter like facet_grid #25

Closed
hadley opened this Issue · 7 comments

6 participants

Hadley Wickham Ben Bolker Luciano Selzer peacej John Williams Josh Klontz
Hadley Wickham
Owner

No description provided.

Ben Bolker
bbolker commented

bump? I would love to have this ... should I try to dig in and write it myself or is it likely to be tricky?

Hadley Wickham
Owner
hadley commented

Hmmm, it shouldn't be too hard if you follow a parallel path to facet_grid. One roadblock is figuring out what arguments the function should accept.

Luciano Selzer

I'm trying to implent this. However, I cannot figure out why it doesn't render the parsed labels, instead I get expression(...).
Here's my modified code:
facet_strips.wrap <- function(facet, panel, theme) {
labeller <- match.fun(facet$labeller)

labels_df <- panel$layout[names(facet$facets)]
labels_df[] <- llply(labels_df, function(df) labeller(names(df), df))

labels <- apply(labels_df, 1, paste, collapse=", ")

list(t = llply(labels, ggstrip, theme = theme))
}

What am I missing?

Winston Chang wch referenced this issue from a commit in wch/ggplot2
Winston Chang wch Allow parsing expressions in facet_wrap
Fixes #25
1062909
peacej
peacej commented

Bump.. facet_wrap indeed needs a labeller parameter like facet_grid...

John Williams

If +1 is of any value, +1. If not, NULL

Hadley Wickham
Owner

This sounds like a great feature, but unfortunately we don't currently have the development bandwidth to support it. If you'd like to submit a pull request that implements this feature, please follow the instructions in the development vignette.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.