Files
su2026rwep/SD/4.2_实践部分/index.qmd
T
2026-05-21 15:08:20 +08:00

95 lines
1.2 KiB
Plaintext

---
title: "数据前处理+ggplot2画图实践"
format:
dwsd-revealjs:
logo: _extensions/drwater/dwsd/inst/ucaslogo.png
---
```{r}
#| include: false
#| cache: false
lang <- "cn"
require(tidyverse)
require(learnr)
```
```{r}
#| echo: false
source("../../coding/_common.R")
library(tidyverse)
```
## 数据说明
```{r}
mpg
```
## 完成图1
```{r}
#| echo: false
mpg |>
ggplot(aes(x = displ, y = hwy, color = class)) +
geom_point()
```
## 完成图2
```{r}
#| echo: false
ggplot(mpg, aes(x = displ, y = hwy, color = drv)) +
geom_point() +
geom_smooth(aes(linetype = drv))
```
## 完成图3
```{r}
#| echo: false
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point(aes(color = class)) +
geom_smooth()
```
## 完成图4
```{r}
#| echo: false
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point() +
facet_wrap(~cyl)
```
## 完成图5
```{r}
#| echo: false
ggplot(mpg, aes(x = drv, fill = class)) +
geom_bar(position = "fill")
```
## 综合实践:三维荧光数据处理
## 欢迎讨论!{.center}
```{r}
#| results: 'asis'
#| echo: false
rmdify::slideend(
wechat = FALSE,
type = "public",
tel = FALSE,
thislink = "../"
)
```