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

data manipulation fun for plot_dist() #12

Open
lwarode opened this issue Jul 22, 2022 · 1 comment
Open

data manipulation fun for plot_dist() #12

lwarode opened this issue Jul 22, 2022 · 1 comment

Comments

@lwarode
Copy link
Collaborator

lwarode commented Jul 22, 2022

create data manipulation fun/method that corresponds with plot_dist()

  • so far count_data() is producing a summarized data frame that is not suitable for a distribution plot as called with plot_dist()

  • function/method should work like in a similar manner like the following code snippet:

# age of first speech per electoral term
speeches %>%
  select(- speech_content) %>%
  group_by(electoral_term, politician_id) %>%
  filter(date == min(date)) %>%
  distinct(politician_id, electoral_term, .keep_all = T) %>%
  left_join(politicians, by = c("politician_id" = "id")) %>%
  mutate(age_first_speech_lp = get_age_hist(date, birth_date) %>% as.numeric) %>%
  ungroup() %>% 
  plot_dist("age_first_speech_lp", "electoral_term")
@lwarode lwarode changed the title create data manipulation fun/method that corresponds with plot_dist() data manipulation fun for plot_dist() Jul 25, 2022
@lwarode
Copy link
Collaborator Author

lwarode commented Aug 9, 2022

  • maybe just show sample data manipulation in vignette
  • it might be too specific and not generalisable enough

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