1. Πίνακας συχνοτήτων

colors = c("Κόκκινο", "Μπλε", "Πράσινο", "Κόκκινο", "Μπλε", "Κόκκινο")
my.table = as.data.frame(table(colors))
my.table$Perc = round(my.table$Freq / sum(my.table$Freq) * 100, 1)
my.table


2. Ραβδόγραμμα

colors = c("Κόκκινο", "Μπλε", "Πράσινο", "Κόκκινο", "Μπλε", "Κόκκινο")
barplot(table(colors), main="Αγαπημένο χρώμα", xlab="Χρώμα", axes = F, col = c("firebrick1" , "dodgerblue3", "chartreuse3"))
axis(2, c(0,1,2,3)


3. Κυκλικό διάγραμμα

cols = c("firebrick1" , "dodgerblue3", "chartreuse3")
pielabels= paste(my.table$Perc, "%", sep="")
pie(table(colors), radius = 1, main="Αγαπημένο χρώμα", col= cols, labels=pielabels, cex=0.8)
legend("topright", c("Κόκκινο", "Μπλε", "Πράσινο"), cex=0.8, fill=cols)