1 Star 1 Fork 1

LuWinter/R-for-Data-Science

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Chapter 5.R 1012 Bytes
一键复制 编辑 原始数据 按行查看 历史
LuWinter 提交于 2020-07-27 01:06 . R数据科学
library(tidyverse)
ggplot(data = diamonds) +
geom_bar(mapping = aes(x = cut))
diamonds %>% count(cut)
ggplot(data = diamonds) +
geom_histogram(mapping = aes(x = y), binwidth = 0.5) +
coord_cartesian(ylim = c(0, 50))
unusual <- diamonds %>% filter(y < 3 | y > 20)
diamonds %>% count(cut_width(y, 0.5))
ggplot(data = diamonds, mapping = aes(x = carat, color = cut)) +
geom_freqpoly(binwidth = 0.5)
ggplot(data = faithful, mapping = aes(x = eruptions)) +
geom_histogram(binwidth = 0.1)
ggplot(data = diamonds, mapping = aes(x = price)) +
geom_histogram(binwidth = 200) +
coord_cartesian(ylim = c(0, 2000))
diamonds %>% count(x)
unusual2 <- diamonds %>% filter(y < 2 | y > 20)
filter(diamonds, carat == 1) %>% arrange(desc(price))
ggplot(data = diamonds, mapping = aes(x = price, y = ..density.., color = cut)) +
geom_freqpoly(binwidth = 1000)
diamonds2 <- diamonds %>%
mutate(y = ifelse(y < 3 | y > 20, NA, y))
ggplot(data = diamonds2, mapping = aes(x = x, y = y)) +
geom_point(na.rm = T)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
R
1
https://gitee.com/luwinter/R-for-Data-Science.git
git@gitee.com:luwinter/R-for-Data-Science.git
luwinter
R-for-Data-Science
R-for-Data-Science
master

搜索帮助