当前位置:网站首页>Visualization of R language nutrient dataset

Visualization of R language nutrient dataset

2022-06-22 20:54:00 Mrrunsen

stay flexclust Nutrition data set in package , It includes the right to 27 Seed meat 、 Measurement of nutrients in fish and poultry

energy Food energy ( calories ).
protein protein ( g ).
fat fat ( g ).
calcium calcium ( mg ).
iron iron ( mg ).

Whether there are missing values in the dataset

data(nutrient, package="flexclust") 
library(VIM )
aggr(nutrient, prop=FALSE, numbers=TRUE)

People often say that the more fat , The more energy food has , Is this right ?

ggplot(nutrient) +
  aes(x = energy , y = fat) + 
  geom_point()   + stat_smooth()

The more fat , The more energy food has , The scatter plot tells you that this is the right view

library(ggcorrplot)
nutrient %>%
  cor() %>%
  round(2) %>%
  ggcorrplot(hc.order = TRUE,lab = TRUE)

原网站

版权声明
本文为[Mrrunsen]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221917182098.html