update data

This commit is contained in:
Ming Su 2024-03-26 16:58:06 +08:00
parent 437ad3553d
commit 8f7341bba4
1721 changed files with 54 additions and 13 deletions

View File

@ -49,7 +49,7 @@ knitr::opts_chunk$set(echo = TRUE)
- 采用`R语言`+`quarto`完成 - 采用`R语言`+`quarto`完成
- 网页公开:[https://drwater.rcees.ac.cn/course/public/RWEP/\@PUB/index.html](https://drwater.rcees.ac.cn/course/public/RWEP/@PUB/index.html) - 网页公开:[https://drwater.rcees.ac.cn/course/public/RWEP/\@PUB/index.html](https://drwater.rcees.ac.cn/course/public/RWEP/@PUB/index.html)
- 课件代码:[https://drwater.rcees.ac.cn/git/course/RWEP.git](https://drwater.rcees.ac.cn/git/course/RWEP.git) - 课件代码:[https://drwater.rcees.ac.cn/git/course/RWEP.git](https://drwater.rcees.ac.cn/git/course/RWEP.git)
- 代码web界面 [https://on.tty-share.com/s/hWkn5_eF6rfZuAyJu8sheMgrcRzx6AZ2m7V32IphFHs7gn-vP9WYOeVEYtH8a-bGTuM/](https://on.tty-share.com/s/hWkn5_eF6rfZuAyJu8sheMgrcRzx6AZ2m7V32IphFHs7gn-vP9WYOeVEYtH8a-bGTuM/) - 代码web界面[https://on.tty-share.com/s/ny3JVrMuvUNOmnuioS3I7YEeVCi5Hk3Qc9vgz2QdX0FE2cYAQZFW2MUOkQyG0P5ZUR8/](https://on.tty-share.com/s/ny3JVrMuvUNOmnuioS3I7YEeVCi5Hk3Qc9vgz2QdX0FE2cYAQZFW2MUOkQyG0P5ZUR8/)
## 如何学习接下来的内容? ## 如何学习接下来的内容?

View File

@ -36,7 +36,6 @@ library(tidyverse)
library(nycflights13) library(nycflights13)
``` ```
## tidy data ## tidy data
```{r} ```{r}
@ -136,14 +135,20 @@ flights|>filter(dest=="IAH")|>
group_by(year,month,day)|>summarize(n=n(), group_by(year,month,day)|>summarize(n=n(),
delay=mean(arr_delay,na.rm=TRUE))|>filter(n>10) delay=mean(arr_delay,na.rm=TRUE))|>filter(n>10)
flights|>filter(carrier=="UA",
dest%in%c("IAH","HOU"),sched_dep_time>
0900,sched_arr_time<2000)|>group_by(flight)|>
summarize(delay=mean(
arr_delay,na.rm=TRUE),cancelled=sum(is.na(arr_delay)),
n=n())|>filter(n>10)
``` ```
## 练习
```{r}
#| eval: false
flights |>
filter(dest == "IAH") |>
group_by(year, month, day) |>
summarize(n = n(),
delay = mean(arr_delay, na.rm = TRUE)) |>
filter(n > 10)
```
## quarto ## quarto

View File

@ -274,12 +274,27 @@ geom_point(aes(fill = Area)) +
dwfun::theme_sci() dwfun::theme_sci()
``` ```
## 练习
```{r}
#| eval: false
metadf <- readxl::read_xlsx("../../data/airquality.xlsx")
dir.create("../../data/metacity2/")
metadf |>
nest(sitedf = -site) |>
mutate(flag = purrr::map2(site, sitedf,
~ writexl::write_xlsx(.y, paste0("../../data/metacity2/", .x, ".xlsx"))))
```
## 练习 ## 练习
```{r} ```{r}
#| include: false #| include: false
#| eval: false #| eval: false
if (FALSE) { if (FALSE) {
require(tidyverse)
conn <- cctdb::get_dbconn("nationalairquality") conn <- cctdb::get_dbconn("nationalairquality")
metadf <- tbl(conn, "metadf") |> metadf <- tbl(conn, "metadf") |>
collect() collect()

View File

@ -1208,6 +1208,21 @@ semi_join(df1, df2, by = "id")
``` ```
## 练习
合并`airquality.xlsx`中的数据。
## 练习
统计各城市白天与晚上的大气质量差异计算不同指标差异最大的10个城市。
## 欢迎讨论!{.center} ## 欢迎讨论!{.center}

View File

@ -37,8 +37,8 @@ require(learnr)
## 第7次课后作业 ## 第7次课后作业
1. 根据`airqualitydf.xlsx`,按采样点统计周末2天与工作日5天中空气质量指数AQI中位数按城市统计低于所有采样点AQI30%分位值的采样点占比列出上述占比最高的10个城市不考虑采样点数低于5个的城市 1. 根据`airqualitydf.xlsx`,按采样点统计白天8:00-20:00与夜晚20:00-8:00中空气质量指数AQI中位数按城市统计低于所有采样点AQI30%分位值的采样点占比列出上述占比最高的10个城市不考虑采样点数低于5个的城市
2. 按照不同城市分组,统计周末2天与工作日5天AQI中位数是否具有显著差异。 2. 按照不同城市分组,统计白天与夜晚AQI中位数是否具有显著差异。
作业模板:[第7次课后作业_模板.qmd](https://drwater.rcees.ac.cn/git/course/RWEP/raw/branch/main/SD/20240326_9_课后作业/第7次课后作业_模板.qmd) 作业模板:[第7次课后作业_模板.qmd](https://drwater.rcees.ac.cn/git/course/RWEP/raw/branch/main/SD/20240326_9_课后作业/第7次课后作业_模板.qmd)

View File

@ -18,8 +18,8 @@ total
``` ```
# 根据`airqualitydf.xlsx`,按采样点统计周末2天与工作日5天中空气质量指数AQI中位数按城市统计低于所有采样点AQI30%分位值的采样点占比列出上述占比最高的10个城市不考虑采样点数低于5个的城市 # 根据`airqualitydf.xlsx`,按采样点统计白天8:00-20:00与夜晚20:00-8:00中空气质量指数AQI中位数按城市统计低于所有采样点AQI30%分位值的采样点占比列出上述占比最高的10个城市不考虑采样点数低于5个的城市
# 按照不同城市分组,统计周末2天与工作日5天AQI中位数是否具有显著差异。 # 按照不同城市分组,统计白天与夜晚AQI中位数是否具有显著差异。

View File

@ -24,7 +24,7 @@ website:
page-navigation: true page-navigation: true
page-footer: "Copyright 2024, [Ming Su](https://drwater.rcees.ac.cn)" page-footer: "Copyright 2024, [Ming Su](https://drwater.rcees.ac.cn)"
navbar: navbar:
background: "grey" background: "light"
search: true search: true
right: right:
- icon: house - icon: house

0
coding/lesson7.qmd Normal file
View File

Binary file not shown.

BIN
data/metacity2/1001A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1002A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1003A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1004A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1005A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1006A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1007A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1008A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1009A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1010A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1011A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1012A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1015A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1017A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1018A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1019A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1021A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1023A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1024A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1026A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1027A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1029A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1030A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1031A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1032A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1033A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1034A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1035A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1037A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1038A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1040A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1041A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1042A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1043A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1044A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1046A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1048A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1049A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1050A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1051A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1052A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1053A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1054A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1056A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1057A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1059A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1060A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1061A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1062A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1063A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1064A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1065A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1066A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1067A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1068A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1070A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1071A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1072A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1073A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1074A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1075A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1077A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1078A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1079A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1080A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1081A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1083A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1084A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1085A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1086A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1087A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1088A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1090A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1091A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1094A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1095A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1096A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1097A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1098A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1099A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1100A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1102A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1103A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1104A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1105A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1106A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1108A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1109A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1110A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1111A.xlsx Normal file

Binary file not shown.

BIN
data/metacity2/1112A.xlsx Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More