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
library(readxl)
# dat <-mtcars
# /Users/limjiyun/Desktop/F1/F1 2
# write.csv(dat,file='/Users/limjiyun/Desktop/F1/F1 2/mtcarsexample.csv')
data <- read_csv('/Users/limjiyun/Desktop/F1/F1 2/mtcarsexample.csv')
## New names:
## Rows: 32 Columns: 12
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (1): ...1 dbl (11): mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...1`
dat <- read_excel('/Users/limjiyun/Desktop/F1/nonParametric.xlsx')
head(dat) 
## # A tibble: 6 × 2
##   groupA groupB
##    <dbl>  <dbl>
## 1   15.9   15.7
## 2   33.9   20.8
## 3   29.1   23.7
## 4   37.7   26.3
## 5   30     34.7
## 6    8.4   40.1
str(dat) 
## tibble [45 × 2] (S3: tbl_df/tbl/data.frame)
##  $ groupA: num [1:45] 15.9 33.9 29.1 37.7 30 8.4 12.5 19.8 12.1 17.5 ...
##  $ groupB: num [1:45] 15.7 20.8 23.7 26.3 34.7 40.1 13.4 11.4 15.1 15.9 ...
dim(dat)
## [1] 45  2
shapiro_test(dat$groupB)
## # A tibble: 1 × 3
##   variable   statistic  p.value
##   <chr>          <dbl>    <dbl>
## 1 dat$groupB     0.876 0.000182

R Markdown

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

Including Plots

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.