# Exercice 1 Solution

#### 2023-06-25

- Create a Rmarkdown with the following information:

  - Title: “Exercice 1”
  - Date: Date when the Rmarkdown was generate (automatically change if it is runned another day)
  - report as a html document
  - Create necessary title and subtitle

- Create a simple chunck of code with a simple addition

- Load iris dataset using the following function: data(iris)

- Display your iris data.frame, writing iris in a chunk.

  - Add df_print: paged in your YAML header in the html document option and display the iris data.frame again.
  - Show rows 6 by 6 by using the rows.print options in chunk option

- Show the boxplot of the iris dataset using boxplot(iris)

- Write the mean Sepal length, embedded in a text

- Show Sepal length, width and Petal length, width using tabs and the function plot(), e.g. plot(iris$Sepal.Width)

- Add sessionInfo() at the end of the document

# Show some code:

    1 + 1

    ## [1] 2

# Load some package

    data(iris)

# See the data.frame

As paged

    iris

# Boxplot of iris data

    boxplot(iris)

# Insert R code in the text

The Sepal length is 5.8433333

# Hide some code

The code below is not showed in the html report. Only the result:

Mean Sepal Width:

    ## [1] 3.057333

# Data displayed in tab

## Sepal Length

    plot(iris$Sepal.Length)

## Sepal Width

    plot(iris$Sepal.Width)

## Petal Length

    plot(iris$Petal.Length)

# Session

    sessionInfo()

    ## R version 4.2.2 (2022-10-31 ucrt)
    ## Platform: x86_64-w64-mingw32/x64 (64-bit)
    ## Running under: Windows 10 x64 (build 22621)
    ##
    ## Matrix products: default
    ##
    ## locale:
    ## [1] LC_COLLATE=French_Switzerland.utf8  LC_CTYPE=French_Switzerland.utf8
    ## [3] LC_MONETARY=French_Switzerland.utf8 LC_NUMERIC=C
    ## [5] LC_TIME=French_Switzerland.utf8
    ##
    ## attached base packages:
    ## [1] stats     graphics  grDevices utils     datasets  methods   base
    ##
    ## loaded via a namespace (and not attached):
    ##  [1] digest_0.6.30   R6_2.5.1        lifecycle_1.0.3 jsonlite_1.8.3
    ##  [5] magrittr_2.0.3  evaluate_0.18   highr_0.9       stringi_1.7.8
    ##  [9] cachem_1.0.6    rlang_1.0.6     cli_3.4.1       rstudioapi_0.14
    ## [13] jquerylib_0.1.4 bslib_0.4.1     vctrs_0.5.2     rmarkdown_2.18
    ## [17] tools_4.2.2     stringr_1.5.0   glue_1.6.2      xfun_0.34
    ## [21] yaml_2.3.6      fastmap_1.1.0   compiler_4.2.2  htmltools_0.5.3
    ## [25] knitr_1.41      sass_0.4.2