Loading dataset
Here we will load the dataset, (Remember to drop the non-numerical column). Since the iris flower dataset contains a species column that is of character type so we need to drop it because PCA works with only numerical data.
R
# drop the species column as its character type num_iris = subset (iris, select = - c (Species)) head (num_iris) |
Output:
How To Make Scree Plot in R with ggplot2
In this article, we are going to see how can we plot a Scree plot in R Programming Language with ggplot2.