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

long data format visualisations using gghighlight #51

Open
njtierney opened this issue Jul 19, 2019 · 0 comments
Open

long data format visualisations using gghighlight #51

njtierney opened this issue Jul 19, 2019 · 0 comments

Comments

@njtierney
Copy link
Owner

Some things like this where we split plots into facets based on features would be neat. Perhaps might be worthwhile to include a "gather_features()" or something function, to facilitate this.

library(gghighlight)
#> Loading required package: ggplot2
library(brolgar)
library(tidyverse)
wages_ts %>%
  features(ln_wages, feat_monotonic) %>%
  left_join(wages_ts, by = "id") %>%
  select(id:xp) %>%
  gather(key = "features",
         value = "inc_dec",
         - id,
         - unvary,
         - monotonic,
         - ln_wages,
         - xp) %>%
  filter(inc_dec) %>%
  ggplot(aes(x = xp,
             y = ln_wages,
             group = id)) + 
  geom_line() + 
  gghighlight() + 
  facet_wrap(~features)

Created on 2019-07-19 by the reprex package (v0.3.0)

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

1 participant