1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
#------------------ # Data Preparation #------------------ #Read datasets #Download the data from http://www.saedsayad.com/datasets/CreditData.zip train <- read.csv("Credit_train.csv") test <- read.csv("Credit_test.csv") #Rows and Cols dim(train) dim(test) #Columns name colnames(train) colnames(test) #Show head(train) head(test) #------------------------------------------------------ # Data Exploration - Univariate analysis - Categorical #------------------------------------------------------ #Statistics summary(train) summary(test) #Credit Default plot(train$DEFAULT, main="Credit Default", sub="train", xlab="DEFAULT", col="darkgreen") plot(test$DEFAULT, main="Credit Default", sub="test", xlab="DEFAULT", col="brown") #BUSTYPE plot(train$BUSTYPE, main="Type of small business", sub="train", xlab="BUSTYPE", col="darkgreen") plot(test$BUSTYPE, main="Type of small business", sub="test", xlab="BUSTYPE", col="brown") |
Ejercicio en R Categoricas
Mapa -> Exploración -> Univariables -> Categóricas