library(tidyverse)
library(rio)
library(sjmisc)
library(here) # 仅是quarto文档中需要使用here()命令打开、保存文件
library(showtext) # mac电脑调整字体,wins可不用
showtext_auto() # mac电脑调整字体,wins可不用
std <- import(here("files/data/cepsw2studentCN.dta"))
std1 <- std %>%
filter(w2upeng==100) %>%
group_by(schids) %>%
summarise(eng_mean=mean(w2eng,na.rm=TRUE)) %>%
mutate(schids=factor(schids))
std1 %>% ggplot()+
geom_col(aes(y=fct_reorder(schids, eng_mean),x=eng_mean))+
labs(x="英语成绩学校均分",y="学校序号",
title = "图1. 学生英语成绩学校均分排序图",
caption = "数据来源:CEPS2014-2015年数据")+
theme_minimal()


