Pie Chart using ggplot2 package (R Programming)

Alok Pratap Singh

December, 2020

Loading Data

library(dplyr, warn.conflicts = F) # for data manipulation
foreign::read.spss("Feedbach Data.sav",
                   to.data.frame = T) -> data  # reading spss (.sav) file
## re-encoding from UTF-8

Loading libraries

library(dplyr, warn.conflicts = F)
library(ggplot2)
theme_set(theme_void())   # Permanent theme
library(ggthemes)
library(ggsci)
as_tibble(data) -> data  # modern data frame
colnames(data)
##  [1] "Item1"  "item2"  "item3"  "item4"  "item5"  "item6"  "item7"  "item8" 
##  [9] "item9"  "item10" "item11" "item12" "item13" "item14" "item15" "item16"
## [17] "item17" "item18" "item19" "item20" "item21" "item22" "item23" "item24"
## [25] "item25" "item26" "item27" "item28" "item29" "item30" "item31" "item32"
## [33] "item33" "item34" "item35" "item36"
names(data) <- tolower(names(data))

Structure of data

glimpse(data)
## Rows: 206
## Columns: 36
## $ item1  <fct> very good, very good, very good, very good, very good, very goo~
## $ item2  <fct> very good, very good, very good, good, very good, very good, ve~
## $ item3  <fct> very good, very good, very good, very good, very good, very goo~
## $ item4  <fct> good, very good, very good, very good, good, very good, very go~
## $ item5  <fct> very good, good, good, very good, very good, very good, very go~
## $ item6  <fct> poor, very good, good, good, good, average, good, good, very go~
## $ item7  <fct> good, very good, very good, good, very good, very good, very go~
## $ item8  <fct> very good, very good, very good, very good, very good, very goo~
## $ item9  <fct> very good, very good, very good, very good, very good, very goo~
## $ item10 <fct> very good, very good, very good, very good, very good, very goo~
## $ item11 <fct> very good, very good, very good, very good, very good, very goo~
## $ item12 <fct> very good, very good, very good, very good, very good, very goo~
## $ item13 <fct> very good, very good, good, very good, very good, very good, ve~
## $ item14 <fct> very good, very good, very good, very good, very good, very goo~
## $ item15 <fct> very good, very good, very good, very good, very good, very goo~
## $ item16 <fct> very good, very good, very good, very good, very good, very goo~
## $ item17 <fct> good, very good, very good, very good, very good, very good, ve~
## $ item18 <fct> very good, very good, very good, very good, very good, very goo~
## $ item19 <dbl> 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 2, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, ~
## $ item20 <dbl> 3, 3, 3, 4, 4, 3, 4, 4, 4, 3, 3, 3, 4, 4, 4, 4, 3, 4, 3, 1, 3, ~
## $ item21 <dbl> 3, 4, 3, 4, 4, 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 4, 4, 3, 4, 3, ~
## $ item22 <dbl> 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 1, 4, ~
## $ item23 <dbl> 2, 3, 3, 4, 4, 3, 3, 3, 4, 3, 3, 4, 4, 4, 4, 4, 3, 4, 3, 4, 4, ~
## $ item24 <dbl> 3, 4, 3, 4, 3, 3, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 3, 3, 4, 1, 4, ~
## $ item25 <dbl> 4, 3, 4, 3, 3, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, ~
## $ item26 <dbl> 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4, ~
## $ item27 <dbl> 1, 4, 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 3, 4, 4, 4, 1, 1, 4, 4, 4, ~
## $ item28 <dbl> 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 1, 3, ~
## $ item29 <dbl> 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, ~
## $ item30 <dbl> 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, ~
## $ item31 <dbl> 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, ~
## $ item32 <dbl> 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, ~
## $ item33 <dbl> 3, 4, 1, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 4, ~
## $ item34 <dbl> 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, ~
## $ item35 <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ~
## $ item36 <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, ~

Data Frame

kableExtra::kable(data[1:5,16:22])
item16 item17 item18 item19 item20 item21 item22
very good good very good 4 3 3 4
very good very good very good 4 3 4 4
very good very good very good 2 3 3 4
very good very good very good 4 4 4 4
very good very good very good 4 4 4 4

Data Pre-processing

data  %>% mutate(item19 = factor(
  item19,
  4:1,
  labels = c("adequate", "inadequate", "challenging", "dull")
), 
  item20 = factor(
    item20,
    4:1,
    labels = c("more than adequate", "adequate", "inadequate", "can't say")
  ),
  item21 =  factor(
    item21,
    4:1,
    labels = c("easy", "manageable", "difficult", "v.difficult")
  ),
  item22 = factor(
    item22, 4:1,
    labels = c(">85%", "<85%", "<70%", "<55%")
    ),
  item23 = factor(
    item23,
    4:1,
    labels = c("more than adequate", "adequate", "inadequate", "very poor")
  ),
  item24 = factor(
    item24,
    4:1,
    labels = c("very easily", "easily", "never", "hardly")
  ), 
  item25 = factor(
    item25,
    4:1,
    labels = c("throughly", "satisfactorily", "poorly", "indifferently")
  ),
  item26 = factor(
    item26,
    4:1,
    labels = c("always effective", "sometime effective", "just effective", "generally ineffective" )
  ),
  item27 = factor(
    item27,
    4:1,
    labels = c("mostly yes", "sometimes", "never", "always")
  ),
  item28 = factor(
    item28,
    4:1,
    labels = c("rise questions", "discussion in class", "discussion outside class", "no encouragement")
  ),
  item29 = factor(
    item29,
    4:1,
    labels = c("always", "sometime", "never", "did'nt advise")
  ),
  item30 = factor(
    item30,
    4:1,
    labels = c("always courteous", "sometime rude", "always indifferent", "can't say")
  ),
  item31 = factor(
    item31,
    4:1,
    labels = c("always fair", "sometimes unfair", "usually unfair", "sometimes fair")
  ),
  item32 = factor(
    item32,
    4:1,
    labels = c("helps to improve", "discouraging", "no special effect", "sometimes effects")
  ),
  item33 = factor(
    item33,
    4:1,
    labels = c("regularly/in time","with helpful comments","often late","without comments")
  ),
  item34 = factor(
    item34,
    4:1,
    labels = c("yes, fully", "yes, partly", "never", "sometime discussed")
  ),
  item35 = factor(
    item35,
    1:0 ,
    labels = c("yes", "no")
    ),
  item36 = factor(
    item36,
    1:0,
    labels = c("yes", "no")
    )
) -> data

Percentage

for(i in 1:ncol(data)) {
  print(colnames(data[i]))
  print(round(prop.table(table(data[i])) * 100))
}
## [1] "item1"
## 
##      poor   average      good very good 
##         0         4        25        70 
## [1] "item2"
## 
##      poor   average      good very good 
##         0         3        28        69 
## [1] "item3"
## 
##      poor   average      good very good 
##         2        10        33        55 
## [1] "item4"
## 
##      poor   average      good very good 
##         0         5        15        80 
## [1] "item5"
## 
##      poor   average      good very good 
##         0         4        29        67 
## [1] "item6"
## 
##      poor   average      good very good 
##         3        11        42        44 
## [1] "item7"
## 
##      poor   average      good very good 
##         1         5        41        52 
## [1] "item8"
## 
##      poor   average      good very good 
##         0         3        26        71 
## [1] "item9"
## 
##      poor   average      good very good 
##         0         2         8        89 
## [1] "item10"
## 
##      poor   average      good very good 
##         0         2        24        73 
## [1] "item11"
## 
##      poor   average      good very good 
##         0         1        22        77 
## [1] "item12"
## 
##      poor   average      good very good 
##         0         2        20        78 
## [1] "item13"
## 
##      poor   average      good very good 
##         0         6        37        57 
## [1] "item14"
## 
##      poor   average      good very good 
##         0         6        47        47 
## [1] "item15"
## 
##      poor   average      good very good 
##         0         4        25        70 
## [1] "item16"
## 
##      poor   average      good very good 
##         0         7        36        56 
## [1] "item17"
## 
##      poor   average      good very good 
##         0         3        36        60 
## [1] "item18"
## 
##      poor   average      good very good 
##         0         3        20        77 
## [1] "item19"
## 
##    adequate  inadequate challenging        dull 
##          85           3          12           0 
## [1] "item20"
## 
## more than adequate           adequate         inadequate          can't say 
##                 35                 61                  0                  4 
## [1] "item21"
## 
##        easy  manageable   difficult v.difficult 
##          50          49           1           0 
## [1] "item22"
## 
## >85% <85% <70% <55% 
##   73   24    2    0 
## [1] "item23"
## 
## more than adequate           adequate         inadequate          very poor 
##                 33                 52                 11                  3 
## [1] "item24"
## 
## very easily      easily       never      hardly 
##          70          28           0           1 
## [1] "item25"
## 
##      throughly satisfactorily         poorly  indifferently 
##             68             31              0              0 
## [1] "item26"
## 
##      always effective    sometime effective        just effective 
##                    90                     7                     2 
## generally ineffective 
##                     1 
## [1] "item27"
## 
## mostly yes  sometimes      never     always 
##         68         10          0         21 
## [1] "item28"
## 
##           rise questions      discussion in class discussion outside class 
##                       54                       42                        2 
##         no encouragement 
##                        1 
## [1] "item29"
## 
##        always      sometime         never did'nt advise 
##            94             6             0             0 
## [1] "item30"
## 
##   always courteous      sometime rude always indifferent          can't say 
##                 92                  4                  3                  0 
## [1] "item31"
## 
##      always fair sometimes unfair   usually unfair   sometimes fair 
##               89                6                1                3 
## [1] "item32"
## 
##  helps to improve      discouraging no special effect sometimes effects 
##                91                 4                 1                 4 
## [1] "item33"
## 
##     regularly/in time with helpful comments            often late 
##                    53                    45                     1 
##      without comments 
##                     1 
## [1] "item34"
## 
##         yes, fully        yes, partly              never sometime discussed 
##                 81                 15                  1                  3 
## [1] "item35"
## 
## yes  no 
##  98   2 
## [1] "item36"
## 
## yes  no 
##  97   3

Pie chart using Base R

par(mar= c(0 , 0, 4, 0))
paste0(c("poor", "average", "good", "very good"),
       "\n",
       "(" ,
       round(prop.table(table(data$item3)),2)*100, "%", ")") -> labl_item3
par(lwd= 3.5)
pie(table(data$item3),
    col= c("gray", 4, "tomato2", 3),
    clockwise = T,
    #density = 400,
    border = "white",
    cex= 1,
    radius = 1,
    labels = labl_item3,
    main= "Pie Chart")

Pie Charts using ggplot2

data %>%
  count(item1) %>%
  mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item1)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(2, 4, 4)
  ) + scale_fill_hue(name = "Responses") +
  labs(subtitle = "1. Depth of the course content including project work \n    if any")

data %>% count(item2) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item2)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(2, 4, 4)
  ) + scale_fill_hue(name = "Responses") +
  labs(subtitle =  "2. Extent of coverage of course")

data %>% count(item3) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item3)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(1, 4, 4, 4)
  ) + scale_fill_hue(name = "Responses") +
  labs(subtitle =  "3. Applicability/ relevance to real life situations")

data %>% count(item4) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item4)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(1, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle =  "4. Learning value (in terms of knowledge, concepts\n    manual skills, analytical abilities and broadening\n    perspectives")

data %>% count(item5) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item5)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(1, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle =  "5. Clarity and relevance of textual reading material")

data %>% count(item6) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item6)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(1, 4, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle =  "6. Relevance of additional source material (Library)")

data %>% count(item7) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item7)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(1, 3, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle =  "7. Extent of effort required by students")

data %>% count(item8) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item8)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(0, 2, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(title = "8. Overall Rating")

data %>% count(item9) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item9)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(0, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "1. Knowledge base of the teacher\n    (as perceived by you)")

data %>% count(item10) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item10)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(0, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "2. Communication Skills\n    (in terms of articulation & comprehensibility)")

data %>% count(item11) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item11)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(0, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "3. Sincerity/ Commitment of the teacher")

data %>% count(item12) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item12)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(0, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "4. Interest generated by the teacher")

data %>% count(item13) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item13)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(3, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "5. Ability to integrate course material with\n    environment/ other issues, to provide a broader\n    perspective")

data %>% count(item14) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item14)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(3, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "6. Ability to integrate content with other courses")

data %>% count(item15) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item15)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(0, 2.4, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "7. Accessibility of the teacher in and out of the\n   class (includes availability of the teacher to\n   motivate further study and discussion outside\n   class")

data %>% count(item16) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item16)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(0, 3.2, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "8. Ability to design quizzes/ tests/ assignments/\n    examinations and projects to evaluate students\n    understanding of the course")

data %>% count(item17) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item17)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(2, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "9. Provision of sufficient time for feedback")

data %>% count(item18) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item18)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(2, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(title = "10. Overall Rating")

data %>% count(item19) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item19)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 2.8, 4, 0)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "1. The syllabus of each course was")

`

data %>% count(item20) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item20)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 3)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "2. Background for benefiting from the course was")

data %>% count(item21) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item21)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 0)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "3. Was the course easy or difficult to understand")

data %>% count(item22) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item22)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 0, 0)
  ) + scale_fill_hue(
    name = "Response",
    labels = c("85 to 100%", "70 to 85%", "55 to 70%", "less than 50%")
  ) +
  labs(subtitle = "4. How much of the syllabus was covered in the class?")

data %>% count(item23) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item23)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 4, 2)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "5. What is your opinion about the library material\n    and facilities for the course?")

data %>% count(item24) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item24)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 0, 0)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "6. To what extent were you able to get material for\n     the prescribed readings?")

data %>% count(item25) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item25)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 0)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "7. How well did the teacher prepare for the class?")

data %>% count(item26) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item26)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 0, 0)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "8. How well was the teacher able to communicate?")

data %>% count(item27) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item27)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "9. How far the teacher encourages student\n    participation in class?")

data %>% count(item28) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item28)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 0, 0)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "10. If yes, which of the following methods were used?")

data %>% count(item29) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item29)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "11. How helpful was the teacher in advising?")

data %>% count(item30) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item30)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 3, 0, 0)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "12. The teacher's approach can best be described as")

data %>% count(item31) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item31)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 3, 0, 2.7)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "13. Internal assessment was")

data %>% count(item32) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item32)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 3, 0, 3)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "14. What effect do you think the internal assessment\n      will have on your course grade?")

data %>% count(item33) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item33)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 0, 0)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "15. How often did the teacher provide feedback on\n      your performance?")

data %>% count(item34) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item34)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 4, 0, 2.8)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "16. Were your assignments discussed with you?")

data %>% count(item35) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item35)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 2)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "17. Were you provided with a course contributory\n      lecture to the beginning?")

data %>% count(item36) %>% mutate(n = n / sum(n) * 100) %>%
  ggplot(aes(x =  "", y = n, fill = item36)) +
  geom_col(width = 1, col = "white") +
  coord_polar(theta = "y", start = 0) + geom_text(
    aes(label = paste0(round(n), "%")),
    position = position_stack(vjust = .5),
    col = "black",
    size = c(4, 2)
  ) + scale_fill_hue(name = "Response") +
  labs(subtitle = "18. If yes, was it helpful?")

Regards

Please visit my profile

Alok Pratap Singh (Research Scholar)

Linkedin (Open in New TAB)

Department of Psychology

University of Allahabad

Without data you’re just another person with an opinion

.