I will just modify the data here. These are not of character type, but numeric as given below.
Is there something I can do so that I get count of each score and the scales are also in accordance with that?
library(tidyverse)
library(janitor)
#>
#> Attaching package: 'janitor'
#> The following objects are masked from 'package:stats':
#>
#> chisq.test, fisher.test
library(scales)
#>
#> Attaching package: 'scales'
#> The following object is masked from 'package:purrr':
#>
#> discard
#> The following object is masked from 'package:readr':
#>
#> col_factor
data<-tibble::tribble(
~student, ~l1c1_total,
"S001", 1L,
"S002", 2L,
"S003", 2L,
"S004", 1L,
"S005", 0L,
"S006", 0L,
"S007", 5L
)
data %>%
ggplot(aes(l1c1_total))+
geom_bar(fill="orange",stat = "count",width = 0.5)+
labs(title = "Performance in Identification and Sorting of shapes",
x="Question score",
y="% of students")+
geom_text(stat='count',aes(label=percent(..count../nrow(data))),vjust=-0.5)+
theme_minimal()
Created on 2022-08-01 by the reprex package (v2.0.1)