I am studying about factors in R, while studying it I have created a vector then used the factor function to convert categorical variable to factor variable.

```
speed_vector <- c("Fast", "Slow", "Slow", "Fast", "Ultra-fast")
factor_speed_vector <- factor(speed_vector)
factor_speed_vector
Fast Slow Slow Fast Ultra-fast
Levels: Fast Slow Ultra-fast
```

As in the vector we can compare the term but after converting into the factors, it does not give information about the comparison of the term.I want to know how I can create the factors by which the terms in the categorical variable is arranged in ordered way.