Skip to content

data manipulation fun for plot_dist() #12

Open
@lwarode

Description

@lwarode

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions