From 1dd4be3b52c0a765ad9fcc233778d8644d439957 Mon Sep 17 00:00:00 2001 From: ming Date: Thu, 21 Mar 2024 22:43:49 +0800 Subject: [PATCH 1/2] publish lesson 6 --- SD/20240321_0_R实践课程/index.qmd | 7 +------ _extensions/inst/css/revealjs.css | 2 +- _quarto.yml | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/SD/20240321_0_R实践课程/index.qmd b/SD/20240321_0_R实践课程/index.qmd index 8d09330..6bd1b5c 100644 --- a/SD/20240321_0_R实践课程/index.qmd +++ b/SD/20240321_0_R实践课程/index.qmd @@ -80,7 +80,6 @@ knitr::opts_chunk$set(echo = TRUE) ```{r} #| echo: false #| output: asis -#| include: false coursememberdf <- readxl::read_xlsx("../../data/course_member.xlsx") nmem <- nrow(coursememberdf) set.seed <- 23 @@ -88,6 +87,7 @@ set.seed <- 23 uiddf <- coursememberdf |> dplyr::mutate(uid = paste0("ruser", sprintf("%02d", sample(1:nmem, nmem)))) |> dplyr::select(uid, 姓名) |> + dplyr::mutate(姓名 = "**") |> dplyr::arrange(uid) |> dplyr::mutate(group = (dplyr::row_number() - 1) %/% 10 + 1) |> tidyr::nest(gdf = -group) |> @@ -106,7 +106,6 @@ uiddf$tab[[2]] ```{r} #| echo: false #| output: asis -#| include: false uiddf$tab[[3]] uiddf$tab[[4]] @@ -144,13 +143,9 @@ author: 姓名 ``` - - - ```` - ## 欢迎讨论!{.center} diff --git a/_extensions/inst/css/revealjs.css b/_extensions/inst/css/revealjs.css index c6e4a50..3344c91 100644 --- a/_extensions/inst/css/revealjs.css +++ b/_extensions/inst/css/revealjs.css @@ -325,7 +325,7 @@ figure > figcaption { .reveal pre code:hover{ font-size: xx-large; - line-height: 250%; + line-height: 150%; } section#title-slide p.subtitle { diff --git a/_quarto.yml b/_quarto.yml index 2a0c2ca..656e14c 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -23,7 +23,7 @@ website: page-navigation: true page-footer: "Copyright 2024, [Ming Su](https://drwater.rcees.ac.cn)" navbar: - background: "grey" + background: "light" search: true right: - icon: house From 437ad3553d05705b3a7c70c6c3278403bd4814bb Mon Sep 17 00:00:00 2001 From: ming Date: Mon, 25 Mar 2024 22:11:41 +0800 Subject: [PATCH 2/2] merge main --- SD/20240321_0_R实践课程/index.qmd | 153 +++++++++++++++++++++++++ _extensions/inst/css/revealjs.css.orig | 0 _quarto.yml | 53 +++++++++ 3 files changed, 206 insertions(+) create mode 100644 SD/20240321_0_R实践课程/index.qmd delete mode 100644 _extensions/inst/css/revealjs.css.orig create mode 100644 _quarto.yml diff --git a/SD/20240321_0_R实践课程/index.qmd b/SD/20240321_0_R实践课程/index.qmd new file mode 100644 index 0000000..40336bb --- /dev/null +++ b/SD/20240321_0_R实践课程/index.qmd @@ -0,0 +1,153 @@ +--- +title: "〇、R语言实践前篇" +subtitle: 《区域水环境污染数据分析实践》
Data analysis practice of regional water environment pollution +author: 苏命、王为东
中国科学院大学资源与环境学院
中国科学院生态环境研究中心 +date: today +lang: zh +format: + revealjs: + theme: dark + slide-number: true + chalkboard: + buttons: true + preview-links: auto + lang: zh + toc: true + toc-depth: 1 + toc-title: 大纲 + logo: ./_extensions/inst/img/ucaslogo.png + css: ./_extensions/inst/css/revealjs.css + pointer: + key: "p" + color: "#32cd32" + pointerSize: 18 +revealjs-plugins: + - pointer +filters: + - d2 +--- + +```{r} +#| include: false +#| cache: false +lang <- "cn" +require(tidyverse) +knitr::opts_chunk$set(echo = TRUE) +``` + +## R语言实践部分课程简介 + +**接下来的课程由我来带着大家一起学习、实践基于R语言的数据分析。** + +### 自我介绍 + +- 苏命:来自中国科学院生态环境研究中心 +- 主要从事**水源水质水生态**方面的研究 + +### 课件 + +- 采用`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/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/) + +## 如何学习接下来的内容? + +- 上课形式: + - **实践操作为主**,目的是让每一位同学都能独立开展基于R的数据分析 + - **2-3人一组**,自由分组,相互帮助 +- 准备工作: + - 个人笔记本电脑,Microsoft Windows、GNU/Linux、MacOS系统 + - 安装好**Microsoft Excel** + - 能联网 + - 如果电池不够用,建议带上插座 +- 上课规则 + - 可随时打断,**不懂就问** + - **无特殊情况不迟到**,否则操作过程容易跟不上 + +## Rstudio Server使用 + +- 服务网址:[https://drwater.rcees.ac.cn/rs1/](https://drwater.rcees.ac.cn/rs1/) +- 每位同学使用1个账号,随机生成 +- 密码:**** +- 后面的实践课程可在该服务器上完成 + + +## 请记住自己的账号! + +::: {layout-ncol=2} + +```{r} +#| echo: false +#| output: asis +coursememberdf <- readxl::read_xlsx("../../data/course_member.xlsx") +nmem <- nrow(coursememberdf) +set.seed <- 23 + +uiddf <- coursememberdf |> + dplyr::mutate(uid = paste0("ruser", sprintf("%02d", sample(1:nmem, nmem)))) |> + dplyr::select(uid, 姓名) |> + dplyr::mutate(姓名 = "XX") |> + dplyr::arrange(uid) |> + dplyr::mutate(group = (dplyr::row_number() - 1) %/% 10 + 1) |> + tidyr::nest(gdf = -group) |> + dplyr::mutate(tab = purrr::map(gdf, ~ knitr::kable(.x))) + +uiddf$tab[[1]] +uiddf$tab[[2]] + +``` +::: + +## 请记住自己的账号! + +::: {layout-ncol=2} + +```{r} +#| echo: false +#| output: asis +uiddf$tab[[3]] +uiddf$tab[[4]] +``` +::: + +## 课后作业 + +提交形式:`第*次作业_姓名.qmd`文件 + +模板: + +```` +--- +title: "课后作业*" +author: 姓名 +--- + + +# 第1题 + +说明 + +```{r} +# Here is the code + +``` + +# 第2题 + +说明 + +```{r} +# Here is the code + +``` + + +```` + + + +## 欢迎讨论!{.center} + + +`r rmdify::slideend(wechat = FALSE, type = "public", tel = FALSE, thislink = "../")` diff --git a/_extensions/inst/css/revealjs.css.orig b/_extensions/inst/css/revealjs.css.orig deleted file mode 100644 index e69de29..0000000 diff --git a/_quarto.yml b/_quarto.yml new file mode 100644 index 0000000..efd4286 --- /dev/null +++ b/_quarto.yml @@ -0,0 +1,53 @@ +project: + type: website + output-dir: www/ + render: + - "*.qmd" + - "!chp*.qmd" + - "!analysis/" + - "!*ignored.qmd" + - "!*ignored/" + - "!coding/" + + +title: "区域水环境污染数据分析实践" +lang: zh +date: today +bibliography: [BB/Ref.bib, BB/localRef.bib] + +website: + title: "Version: {{< var branch >}}" + reader-mode: true + site-url: https://drwater.rcees.ac.cn/{{< var projtype >}}/{{< var pubtype >}}/{{< var reponame >}}/@{{< var branch >}} + repo-url: https://drwater.rcees.ac.cn/git/{{< var projtype >}}/{{< var reponame >}}/src/branch/{{< var branch >}} + repo-actions: [edit, source, issue] + page-navigation: true + page-footer: "Copyright 2024, [Ming Su](https://drwater.rcees.ac.cn)" + navbar: + background: "grey" + search: true + right: + - icon: house + text: "Home" + file: index.qmd + - text: "Slides" + file: SD/index.qmd + - text: "About" + file: about.qmd + - icon: git + menu: + - text: Edit + url: https://drwater.rcees.ac.cn/git/{{< var projtype >}}/{{< var reponame >}}/_edit/ + - text: Issue + url: https://drwater.rcees.ac.cn/git/{{< var projtype >}}/{{< var reponame >}}/issues + comments: + hypothesis: + theme: clean + openSidebar: false + +format: + html: + theme: cosmo + css: _extensions/inst/css/style.css + toc: true + code-link: true