TIDY_HUMAN_TEXTURE <- here("data/processed/tidy_human_texture_response.csv")
LANGUAGE_SIMILARITY <- here("data/processed/animal_texture_langauge_distances_with_anchors.csv")

human_data <- read_csv(TIDY_HUMAN_TEXTURE) %>%
  rename(similarity = prop)
language_data  <- read_csv(LANGUAGE_SIMILARITY) %>%
  rename(texture = anchor,
         similarity = language_similarity)  %>%
  mutate(group = "language")

animal_order <- c("goldfish", "snake", "crocodile", "lizard", "eel", "shark", "turtle", "toad", "dolphin", "frog", "worm", "elephant", "hippo", "rhino", "pig", "platypus", "seal","ferret", "gorilla", "sheep", "fox", "bear", "horse", "donkey", "cat", "penguin", "ostrich","flamingo", "peacock", "pigeon")

Reproduction of 6b with language data

all_data <- bind_rows(human_data, language_data) %>%
    mutate(texture = fct_relevel(texture, "scales", "skin", "fur", "feathers"),
           group = fct_relevel(group, "S", "CB", "language"),
           animal = fct_relevel(animal,  animal_order)) 

# 
all_data %>%
  filter(group != "language") %>%
  ggplot(aes(x = texture, y = fct_rev(animal), fill = similarity))  +
  geom_tile() +
  facet_wrap(~group) +
  ylab("animal") +
  scale_fill_gradient(low = "white", high = "black", limits = c(0,1))  +
  theme_classic()+
  theme(legend.position = "bottom")

all_data %>%
  filter(group == "language") %>%
  ggplot(aes(x = texture, y = fct_rev(animal), fill = similarity))  +
  geom_tile() +
  facet_wrap(~set_id) +
  ylab("animal") +
  scale_fill_gradient(low = "white", high = "black")  +
  theme_classic() +
  theme(legend.position = "bottom")

#cowplot::plot_grid(p1, p2, ncol = 2,label_size = 16, rel_widths = c(2,1))

Correlations with human similarity

Raw similarity

All

all_language_only <- all_data %>%
  filter(group == "language") %>%
  rename(language_similarity = similarity)  %>%
  select(-group, -correct)

lang_raw_comparison_all <- full_join(all_language_only, human_data) %>%
  mutate(similarity = case_when(similarity == 0 ~ .0001, TRUE~ similarity))

ggplot(lang_raw_comparison_all, aes(x = language_similarity, y = similarity, color = group)) +
  ylab("human similarity") +
  facet_wrap(~set_id)+
  geom_point(alpha = .8) + 
  geom_smooth(method = "lm") +
  theme_classic()