Extract Data Frame with One Column
In the code sample below, diamonds dataset from ggplot2 package is used. To work with the example below, one needs to load the ggplot2 library using command such as require(“ggplot2”). In the command below, method as.data.frame is used. Make a note of drop=false parameter passed to as.data.frame method.
dfn1 <- as.data.frame(diamonds[,c(1)], drop=false)
- PCA Explained Variance Concepts with Python Example - August 8, 2020
- Eigenvalues & Eigenvectors with Python Examples - August 7, 2020
- Why & When to use Eigenvalues & Eigenvectors? - August 6, 2020