sapply(c("readr", "pipeR", "dplyr", "tidyr", "ggplot2"), require, character.only=TRUE)
d <- read_csv("teaching_methods.csv")
d
d %>>% summarise_each(funs(mean), 6:8)
d %>>% (scale(.$心理学テスト)) %>>% (~ str(.))
d %>>% (scale(.$心理学テスト)) %>>% (10 * (.) + 50) %>>% (~ str(.))
options(repr.plot.width = 4, repr.plot.height = 4)
library(Cairo)
Cairo(type = "raster")
d %>>%
ggplot(aes(x = `統計テスト1`, y = `統計テスト2`)) +
geom_point() +
theme(axis.title = element_text(family="IPAexGothic"))
dev.off()
with(cov(`統計テスト1`, `統計テスト2`), data = d)
with(cor(`統計テスト1`, `統計テスト2`), data = d)
with(table(数学, 統計), data = d)
with(cor(as.integer(数学), as.integer(統計)), data = d)
str(d)
d %>>% mutate_each(funs(as.factor), 数学:統計) %>>% str
d %>>%
mutate_each(funs(as.factor), 数学:統計) %>>%
mutate_each(funs(as.integer), 数学:統計) %>>%
with(cor(数学, 統計))