学习小组Day4-碳水化合物

嘻嘻,今天还是比较轻松的!
前些日子刚自学了R的一些基础知识,所以今天就是看一些包的作用以及模仿别人做一些图图!
1.tidyverse
install.packages("tidyverse")#安装
library(tidyverse)#载入(使用前一定要先载入哈)

> ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──

> ✔ ggplot2 3.3.2 ✔ purrr 0.3.4

> ✔ tibble 3.0.3 ✔ dplyr 1.0.2

> ✔ tidyr 1.1.2 ✔ stringr 1.4.0

> ✔ readr 1.4.0 ✔ forcats 0.5.0

> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──

> ✖ dplyr::filter() masks stats::filter()

> ✖ dplyr::lag() masks stats::lag()

2.通过help()和“??包的名字”来获取帮助
3.使用gglot2跟着作图试试手感
ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy))


image.png

ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy, color = class))

image.png

ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy, size = class))

image.png

Left

ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy, alpha = class))

Right

ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy, shape = class))

个人感觉还是得自己手动练习,光看还是不行的!
加油!继续努力!

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容