
Let's look more closely to these factor variables. For

now i want to draw your attention to the age.range variable

right here. Notice that it says that we have a

factor variable with seven different levels. We can examine the

levels of a variable, by typing in the command levels

and then putting it the variable right here. In the

console we can see the seven levels of the age.range

variable. Now, instead of creating a table of the age.range

variable, let's create a plot that shows how many users

are in each bin. That is, we want to figure out how

many surveyed respondents are between the ages of 18 and

24, 25 and 34, and so on. I'm going to create this

plot using the ggplot2 package, and the qplot function that

comes with it. Again, don't worry about understanding this code too

much, we'll have practice with this in the next lesson.

When I run this code, I get my plot over here.

Zooming in on this plot, I want you to notice

that the age groups appear to be in order. This is

true for everyone except the survey takers who are under

the age of 18. Now, it would be really helpful if

this bar was really oriented over here. That way we

could make comparisons across the groups more easily. Now this is

why we would want to have ordered factors. The variable age.range just

contains factors with seven levels, but these levels aren't arranged in

any particular order. Sometimes you want to introduce order into our

data set. So that way we can make more readable plots.

So, knowing a little bit about ordered factors, let's see

if you can answer this next question. If you haven't already

done so, download the Reddit survey data and look at

its structure. After you looked at the structure of the variables,

try and answer this question. Which of these variables in

the data set could also be converted to an ordered factor?

Just like H.Range.

>> Check any of the variables that apply.