I need to combine awareness measures for multiple websites into a single barplot. Awareness for each website is measured by a separate nominal variable (Yes/No). I would like to create a plot with one bar per website indicating what percentage of people know the respective website. My first try was creating a vector with number of "Yes" Values divided by "Total Rows" for each website. But with 69 websites there should be a more intelligent way.
The following solution on stack overflow kind of fits what I want to do. How do I plot a number of categorical variables on a graph in R?
But if possible I would like to only display the yes values. Also I would like everything in one graph rather than multiple graphs.
My data frame has the following structure:
gender <- factor(sample(1:2, 5, replace=TRUE), levels = c(1,2,99), labels = c("Male", "Female", "Missing Value"))
age <- sample(18:55, 5, replace=TRUE)
web1 <- factor(sample(1:2, 5, replace=TRUE), levels = c(1,2,99), labels = c("Yes", "No", "Missing Value"))
web2 <- factor(sample(1:2, 5, replace=TRUE), levels = c(1,2,99), labels = c("Yes", "No", "Missing Value"))
web3 <- factor(sample(1:2, 5, replace=TRUE), levels = c(1,2,99), labels = c("Yes", "No", "Missing Value"))
web4 <- factor(sample(1:2, 5, replace=TRUE), levels = c(1,2,99), labels = c("Yes", "No", "Missing Value"))
web5 <- factor(sample(1:2, 5, replace=TRUE), levels = c(1,2,99), labels = c("Yes", "No", "Missing Value"))
df <- data.frame(gender, age, web1, web2, web3, web4, web5)
df