library(tidyverse)
start_data <- tibble::tribble(
~syllabe, ~C, ~V, ~F10, ~F11, ~F12, ~F13, ~F14, ~F15, ~F16, ~F17, ~F18, ~F19, ~F110,
"CV", "w", "e", 1276L, 1088L, 568L, 571L, 587L, 660L, 657L, 558L, 530L, 500L, 1771L,
"CV", "w", "e", 650L, 641L, 628L, 604L, 565L, 523L, 503L, 515L, 547L, 575L, 532L,
"VCs", "l", "a", 637L, 633L, 627L, 619L, 610L, 595L, 579L, 564L, 547L, 525L, 507L,
"CV", "w", "o", 626L, 602L, 578L, 608L, 691L, 715L, 699L, 650L, 610L, 575L, 585L,
"CV", "w", "e", 591L, 557L, 539L, 528L, 536L, 542L, 547L, 562L, 584L, 597L, 572L,
"CVs", "l", "e", 1868L, 1846L, 1825L, 1799L, 1774L, 1190L, 443L, 472L, 477L, 499L, 641L,
"CV", "w", "e", 595L, 595L, 598L, 542L, 486L, 490L, 496L, 489L, 493L, 503L, 530L,
"CV", "l", "e", 555L, 581L, 530L, 487L, 490L, 566L, 589L, 1797L, 1802L, 494L, 580L,
"CV", "w", "e", 675L, 670L, 665L, 663L, 660L, 658L, 650L, 641L, 635L, 629L, 492L,
"CV", "l", "e", 1787L, 1932L, 1745L, 1814L, 1768L, 1735L, 1715L, 1694L, 1687L, 1690L, 504L
)
(long_data <- start_data |> select(-syllabe ,-V) |> pivot_longer(cols = -C) )
(smry_data <- long_data |> group_by(C,name) |>
summarise(avg=mean(value),
stderr=sd(value)/sqrt(n()),
upper=avg+stderr,
lower=avg-stderr))
ggplot(data=smry_data) + aes(
x=name,
y=avg,color=C,
group=C
) + geom_line()+
geom_ribbon(mapping = aes(ymin=lower,
ymax=upper),alpha=0.1,color=rgb(0,0,0,0))