# install.packages('tidyverse')
# install.packages('rstatix')
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.1
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(rstatix)
##
## Attaching package: 'rstatix'
##
## The following object is masked from 'package:stats':
##
## filter
dat<-iris
# install.packages('ggplot2')
library(ggplot2)
ggplot(dat, aes(x=dat$Sepal.Width))+geom_histogram()
## Warning: Use of `dat$Sepal.Width` is discouraged.
## ℹ Use `Sepal.Width` instead.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
shapiro.test(dat$Sepal.Length)
##
## Shapiro-Wilk normality test
##
## data: dat$Sepal.Length
## W = 0.97609, p-value = 0.01018
shapiro.test(dat$Sepal.Width)
##
## Shapiro-Wilk normality test
##
## data: dat$Sepal.Width
## W = 0.98492, p-value = 0.1012
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
You can also embed plots, for example:
Note that the echo = FALSE
parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.