big5=read.csv("D:\\20190803 Hoc tap R\\Dataset\\Big Five Personality Data.csv")
head(big5)
##   race age engnat gender hand source country E1 E2 E3 E4 E5 E6 E7 E8 E9
## 1    3  53      1      1    1      1      US  4  2  5  2  5  1  4  3  5
## 2   13  46      1      2    1      1      US  2  2  3  3  3  3  1  5  1
## 3    1  14      2      2    1      1      PK  5  1  1  4  5  1  1  5  5
## 4    3  19      2      2    1      1      RO  2  5  2  4  3  4  3  4  4
## 5   11  25      2      2    1      2      US  3  1  3  3  3  1  3  1  3
## 6   13  31      1      2    1      2      US  1  5  2  4  1  3  2  4  1
##   E10 N1 N2 N3 N4 N5 N6 N7 N8 N9 N10 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 C1 C2
## 1   1  1  5  2  5  1  1  1  1  1   1  1  5  1  5  2  3  1  5  4   5  4  1
## 2   5  2  3  4  2  3  4  3  2  2   4  1  3  3  4  4  4  2  3  4   3  4  1
## 3   1  5  1  5  5  5  5  5  5  5   5  5  1  5  5  1  5  1  5  5   5  4  1
## 4   5  5  4  4  2  4  5  5  5  4   5  2  5  4  4  3  5  3  4  4   3  3  3
## 5   5  3  3  3  4  3  3  3  3  3   4  5  5  3  5  1  5  1  5  5   5  3  1
## 6   5  1  5  4  5  1  4  4  1  5   2  2  2  3  4  3  4  3  5  5   3  2  5
##   C3 C4 C5 C6 C7 C8 C9 C10 O1 O2 O3 O4 O5 O6 O7 O8 O9 O10
## 1  5  1  5  1  4  1  4   5  4  1  3  1  5  1  4  2  5   5
## 2  3  2  3  1  5  1  4   4  3  3  3  3  2  3  3  1  3   2
## 3  5  1  5  1  5  1  5   5  4  5  5  1  5  1  5  5  5   5
## 4  4  5  1  4  5  4  2   3  4  3  5  2  4  2  5  2  5   5
## 5  5  3  3  1  1  3  3   3  3  1  1  1  3  1  3  1  5   3
## 6  4  3  3  4  5  3  5   3  4  2  1  3  3  5  5  4  5   3
names(big5)
##  [1] "race"    "age"     "engnat"  "gender"  "hand"    "source"  "country"
##  [8] "E1"      "E2"      "E3"      "E4"      "E5"      "E6"      "E7"     
## [15] "E8"      "E9"      "E10"     "N1"      "N2"      "N3"      "N4"     
## [22] "N5"      "N6"      "N7"      "N8"      "N9"      "N10"     "A1"     
## [29] "A2"      "A3"      "A4"      "A5"      "A6"      "A7"      "A8"     
## [36] "A9"      "A10"     "C1"      "C2"      "C3"      "C4"      "C5"     
## [43] "C6"      "C7"      "C8"      "C9"      "C10"     "O1"      "O2"     
## [50] "O3"      "O4"      "O5"      "O6"      "O7"      "O8"      "O9"     
## [57] "O10"
test= big5[, c("gender","E1","E2","E3","E4","E5")]
test$E1 = as.factor(test$E1)
test$E2 = as.factor(test$E2)
test$E3 = as.factor(test$E3)
test$E4 = as.factor(test$E4)
test$E5 = as.factor(test$E5)

library(sjPlot)
plot_likert(test)
## Warning: Detected uneven category count in items. Dropping last category.
## Warning in freq[valid] <- counts: number of items to replace is not a
## multiple of replacement length

## Warning in freq[valid] <- counts: number of items to replace is not a
## multiple of replacement length

## Warning in freq[valid] <- counts: number of items to replace is not a
## multiple of replacement length

## Warning in freq[valid] <- counts: number of items to replace is not a
## multiple of replacement length

## Warning in freq[valid] <- counts: number of items to replace is not a
## multiple of replacement length

## Warning in freq[valid] <- counts: number of items to replace is not a
## multiple of replacement length