25 lines
817 B
Plaintext
25 lines
817 B
Plaintext
---
|
||
title: 课后作业8
|
||
author: 姓名
|
||
format: html
|
||
---
|
||
|
||
# 下载airquality.xlsx,并读取数据
|
||
|
||
```{r}
|
||
# 下载至临时文件
|
||
tmpxlsxpath <- file.path(tempdir(), "airquality.xlsx")
|
||
download.file("https://drwater.rcees.ac.cn/git/course/RWEP/raw/branch/PUB/data/airquality.xlsx",
|
||
destfile = tmpxlsxpath)
|
||
airqualitydf <- readxl::read_xlsx(tmpxlsxpath, sheet = 1)
|
||
metadf <- readxl::read_xlsx(tmpxlsxpath, sheet = 2)
|
||
```
|
||
|
||
# 根据`airqualitydf.xlsx`,按采样点统计白天(8:00-20:00)与夜晚(20:00-8:00)中空气质量指数(AQI)中位数,按城市统计低于所有采样点AQI30%分位值的采样点占比,列出上述占比最高的10个城市(不考虑采样点数低于5个的城市)。
|
||
|
||
|
||
|
||
|
||
|
||
# 按照不同城市分组,统计白天与夜晚AQI中位数是否具有显著差异。
|