rm(list = ls())
library(dplyr)
df <-read.csv("/data/bigfiles/iris.csv")
df <- df %>% as_tibble()
head(df)
新建两列,分别是sepal的长款比(sepal_ratio)和
petal的长宽比(petal_ratio)
df <- df %>%
然后再使用species这一列来分组并汇总
sepal_ratio和petal_ratio的平均值
汇总后的平均值列仍然命名为sepal_ratio和petal_ratio
提示:用group_by和summarize函数
ave <- df %>%
print(round(ave$sepal_ratio, 2))