update data
This commit is contained in:
parent
437ad3553d
commit
8f7341bba4
|
@ -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/)
|
||||||
|
|
||||||
## 如何学习接下来的内容?
|
## 如何学习接下来的内容?
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -1208,6 +1208,21 @@ semi_join(df1, df2, by = "id")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## 练习
|
||||||
|
|
||||||
|
合并`airquality.xlsx`中的数据。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 练习
|
||||||
|
|
||||||
|
统计各城市白天与晚上的大气质量差异,计算不同指标差异最大的10个城市。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 欢迎讨论!{.center}
|
## 欢迎讨论!{.center}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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中位数是否具有显著差异。
|
||||||
|
|
|
@ -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
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue