在 flexclust 包中的营养数据集,它包括对27种肉、鱼和禽的营养物质的测量
energy食物能量(卡路里)。
protein蛋白质(克)。
fat脂肪(克)。
calcium钙(毫克)。
iron铁(毫克)。
数据集是否存在缺失值
data(nutrient, package="flexclust") library(VIM ) aggr(nutrient, prop=FALSE, numbers=TRUE)
人们常说脂肪越多, 食物能量越多,这是对吗?
ggplot(nutrient) + aes(x = energy , y = fat) + geom_point() + stat_smooth()
脂肪越多, 食物能量越多,散点图告诉这个观点是对的
library(ggcorrplot) nutrient %>% cor() %>% round(2) %>% ggcorrplot(hc.order = TRUE,lab = TRUE)



