File:Pca ggplot2.png
Jump to navigation
Jump to search
Size of this preview: 600 × 600 pixels. Other resolution: 1,000 × 1,000 pixels.
Original file (1,000 × 1,000 pixels, file size: 136 KB, MIME type: image/png)
Summary
df <- iris[, 1:4] # exclude "Species" column pca_res <- prcomp(df, scale = TRUE) ggplot(iris, aes(x = pca_res$x[,1], y = pca_res$x[,2], color = Species)) + geom_point() + stat_ellipse()
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 08:58, 23 May 2024 | 1,000 × 1,000 (136 KB) | Brb (talk | contribs) | <syntaxhighlight lang='r'> df <- iris[, 1:4] # exclude "Species" column pca_res <- prcomp(df, scale = TRUE) ggplot(iris, aes(x = pca_res$x[,1], y = pca_res$x[,2], color = Species)) + geom_point() + stat_ellipse() </syntaxhighlight> |
You cannot overwrite this file.
File usage
The following page uses this file: