As Henrik stated, you need to get the data into a factor (at least this is the easiest way to do this). Consider the following example with some fake data ...
#generate 1000 random uniform integers between 1 and 5 data <- floor(runif(1000, 1,6)) #make data a factor with given labels fdata <- factor(data, labels = c("No use", "30 min", "1 hour", "2 hours", "3+ hours"))
This can be done in the r database with a graph (barplot is not required when y is not specified)
You can also build in ggplot2
#in ggplot2 require(ggplot2)
Based on your initial example, in addition to specifying levels, you will need to set ordered=TRUE , as shown below. Otherwise, "No Use" will be displayed at the end of the list.
#get data into a factor (provided data plus "No use") q1 <- c("No use" ,"1 hour" ,"1 hour" ,"30 min" ,"2 hours" ,"3+ hours" ,"3+ hours" ,"3+ hours" ,"3+ hours" ,"2 hours" ,"1 hour" ,"2 hours" ,"1 hour" ,"30 min") q1f = factor(q1, levels = c("No use", "30 min", "1 hour", "2 hours", "3+ hours"), ordered=TRUE)
Then you can apply the graph logic shown above ...