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)
He has also authored the book, Building Web Apps with Spring 5 and Angular.
Latest posts by Ajitesh Kumar (see all)
- When not to use F-Statistics for Multi-linear Regression - July 16, 2019
- R-Squared Explained for Indian Grandma - July 14, 2019
- Machine Learning – Cloud-native Model Deployments - June 29, 2019