library(knitr)
knit("3. excel.Rmd")
## 
## 
## processing file: 3. excel.Rmd
## 
  |                                                                                                                         
  |                                                                                                                   |   0%
  |                                                                                                                         
  |.........                                                                                                          |   8%                   
  |                                                                                                                         
  |..................                                                                                                 |  15% (unnamed-chunk-10)
  |                                                                                                                         
  |...........................                                                                                        |  23%                   
  |                                                                                                                         
  |...................................                                                                                |  31% (unnamed-chunk-11)
  |                                                                                                                         
  |............................................                                                                       |  38%                   
  |                                                                                                                         
  |.....................................................                                                              |  46% (unnamed-chunk-12)
  |                                                                                                                         
  |..............................................................                                                     |  54%                   
  |                                                                                                                         
  |.......................................................................                                            |  62% (unnamed-chunk-13)
  |                                                                                                                         
  |................................................................................                                   |  69%                   
  |                                                                                                                         
  |........................................................................................                           |  77% (unnamed-chunk-14)
  |                                                                                                                         
  |.................................................................................................                  |  85%                   
  |                                                                                                                         
  |..........................................................................................................         |  92% (unnamed-chunk-15)
  |                                                                                                                         
  |...................................................................................................................| 100%                   
## output file: 3. excel.md
## [1] "3. excel.md"
#Verify the package is installed
#install.packages("readxl")
library(readxl)
#read excel file

df_iris_excel <- read_xlsx("iris.xlsx")
print(df_iris_excel)
summary(df_iris_excel)
##   sepal_length    sepal_width     petal_length    petal_width      species         
##  Min.   :4.300   Min.   :2.000   Min.   :1.000   Min.   :0.100   Length:150        
##  1st Qu.:5.100   1st Qu.:2.800   1st Qu.:1.600   1st Qu.:0.300   Class :character  
##  Median :5.800   Median :3.000   Median :4.350   Median :1.300   Mode  :character  
##  Mean   :5.843   Mean   :3.054   Mean   :3.759   Mean   :1.199                     
##  3rd Qu.:6.400   3rd Qu.:3.300   3rd Qu.:5.100   3rd Qu.:1.800                     
##  Max.   :7.900   Max.   :4.400   Max.   :6.900   Max.   :2.500
nrow(df_iris_excel)
## [1] 150
ncol(df_iris_excel)
## [1] 5