The `palmerpenguins` library load the `penguins` dataset into your R environment. If you are not familiar with `tibble`, you just have to know that they are equivalent to `data.frame`.
...
...
@@ -129,10 +129,11 @@ dim(data)
If you are not familiar with the `%>%` operator or pipe in R: It takes the output of the function on the left and pass it as the first argument of the function on the right.
</p>
</details>
For the sake of this practical, we are going to focus on the continuous variables in the data `bill_length_mm`, `bill_depth_mm`, `flipper_length_mm` and `body_mass_g`.
The function `pairs` renders scatter plots of each possible pairs of variables
...
...
@@ -159,6 +160,7 @@ data_f <- data %>%
select(c(bill_length_mm, bill_depth_mm)) # we select the two columns
```
</p>
</details>
```{r}
data %>%
...
...
@@ -203,6 +205,7 @@ map(data_f, sd)
```
`map` apply a function to each element of a list or vector.
</p>
</details>
The package `factoextra` provides us with functions to manipulate and plot the output of the `prcomp` function. The most common usage of the PCA results is to display the individuals on the first factorial plan.
...
...
@@ -222,6 +225,7 @@ fviz_pca_ind(data_f_pca,
)
```
</p>
</details>
<div class="pencadre">
What are the percentages in the Dim1 and Dim2 axes ?