ropensci/lingtypology

color by clade?

IndianaTones opened this issue · 2 comments

Not an issue per se, but was wondering if it is possible to color according to language family rather than default alphabetical order? Thank you!!!

There is no any straightforward way, but I'd do it this way:

library(lingtypology)
library(tidyverse)

tibble(langs = c("Russian", "Polish", "Adyghe", "Chukchi")) %>% 
  mutate(aff = aff.lang(langs),
         aff = str_extract(aff, "^.*?,"),
         aff = str_remove(aff, ",")) %>% 
  map.feature(languages = .$langs,
              feature = .$aff)

Beautiful thank you so much!!