Skip to content

Instantly share code, notes, and snippets.

@syu-id
Last active December 17, 2015 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syu-id/8106d8de999d69f20052 to your computer and use it in GitHub Desktop.
Save syu-id/8106d8de999d69f20052 to your computer and use it in GitHub Desktop.
学習者コーパス論 2015.12.11 作図
library(dplyr)
library(ggplot2)
library(scales)
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'))
)
box_tokens <- ggplot(df_plot, aes(x = native, y = n_token)) +
geom_boxplot(outlier.colour = NA) +
stat_summary(fun.y = mean, geom = 'point', shape = 5, size = 4) +
geom_jitter(aes(color = native), alpha = 0.8) +
scale_y_continuous(breaks = pretty_breaks(n = 8)) +
labs(
x = 'Native Language',
y = 'Tokens in English Essays',
color = 'Native Language'
)
box_types <- ggplot(df_plot, aes(x = native, y = n_type)) +
geom_boxplot(outlier.colour = NA) +
stat_summary(fun.y = mean, geom = 'point', shape = 5, size = 4) +
geom_jitter(aes(color = native), alpha = 0.8) +
scale_y_continuous(breaks = pretty_breaks(n = 8)) +
labs(
x = 'Native Language',
y = 'Types in English Essays',
color = 'Native Language'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment