library(tidyverse)
library(factoextra)
library(cowplot)
library(ggpubr)
library(cluster)
library(purrr)
library(dplyr)
library(readxl)
View(PlantGrowth)
?PlantGrowth
Variables:
data <- PlantGrowth
table(data$group)
##
## ctrl trt1 trt2
## 10 10 10
aggregate(weight~group, data=data, FUN = mean)
## group weight
## 1 ctrl 5.032
## 2 trt1 4.661
## 3 trt2 5.526
ggplot(data= data, aes(x=group, y=weight, color = group)) + geom_boxplot() + theme_bw()
anova = aov(data$weight ~data$group)
summary(anova)
## Df Sum Sq Mean Sq F value Pr(>F)
## data$group 2 3.766 1.8832 4.846 0.0159 *
## Residuals 27 10.492 0.3886
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(TukeyHSD(anova))