Skip to content

Instantly share code, notes, and snippets.

@syu-id
Last active December 17, 2015 13:20
Show Gist options
  • Save syu-id/f4bf8a2f63df2d61e497 to your computer and use it in GitHub Desktop.
Save syu-id/f4bf8a2f63df2d61e497 to your computer and use it in GitHub Desktop.
学習者コーパス論 2015.12.04 作図
library(dplyr)
library(ggplot2)
df <- read.csv('out/2015.12.04-awl_asl.csv')
df_plot <- df %>%
mutate(
native = plyr::revalue(native, c(en = 'L1 English ', ja='L1 Japanese'))
)
token_type <- ggplot(df_plot, aes(n_token, n_type)) +
facet_grid(. ~ native, scales = 'free_x') +
geom_point() +
geom_smooth() +
labs(x = 'Tokens in English Essays', y = 'Types')
token_ttr <- ggplot(df_plot, aes(n_token, ttr)) +
facet_grid(. ~ native, scales = 'free_x') +
geom_point() +
geom_smooth() +
labs(x = 'Tokens in English Essays', y = 'Type Token Ratio')
token_gi <- ggplot(df_plot, aes(n_token, gi)) +
facet_grid(. ~ native, scales = 'free_x') +
geom_point() +
geom_smooth() +
labs(x = 'Tokens in English Essays', y = 'Guiraud Index')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment