langcog / childes-db-shiny

3 stars 2 forks source link

"all" default selector (only for freq app) #5

Closed amsan7 closed 6 years ago

amsan7 commented 7 years ago
amsan7 commented 7 years ago

also side note this repo isn't watched on slack (i can't add as admin perms required)

mcfrank commented 7 years ago

some thoughts on getting grouping to work:

model 1

if (target child == "all") 

  blah %>%
    group_by(other stuff) %>%
    get freqs

else

  blah %>%
    group_by(CHILD, other stuff) %>%
    get freqs

model 2

group_vars <- quos(corpus, age_bin, etc.)

group_var <- ifelse(target_child == "all", group_vars, 
                    append(group_vars, tatget_child)) 

blah %>%
  group_by(UQ(group_vars))

https://github.com/tidyverse/rlang http://maraaverick.rbind.io/2017/08/tidyeval-resource-roundup/ https://edwinth.github.io/blog/dplyr-recipes/?utm_content=buffer51c64&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

mcfrank commented 7 years ago

in particular, goal is to get averages across units when "all" is selected, but within units when specific units are selected, e.g. "all" children gives you one mean, but child x and child y gives you separate series and separate panels for them.