Bardiagramm – Passwortlänge (R)

data <- read.csv('passwort-beantwortet.csv', sep=";")
mx <-data.matrix(data)

cnt <- table(mx) cnt mx barplot (cnt, space =1.0)

werte <- data$Passwortlaenge
C <- hist(werte,1:max(werte))
../_images/output_4_0.png
#!install.packages("plyr", repos='http://cran.us.r-project.org') # wenn nicht schon geschehen
library(plyr)
x <- count(data, "Passwortlaenge")
print(x)
  Passwortlaenge freq
1              5   22
2              8  580
3             15   93
barplot(x$Passwortlaenge,
    names.arg=c('5','8','15'),
    main= "Als sicher eingestufte Passwortlänge",
    xlab="Passwortlänge",
    ylab="Stimmen",
    border="brown",
    col=c("#eb8060", "#b9e38d", "#a1e9f0"),
    )
../_images/output_7_0.png