Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to convert unordered factor to ordered factor in R?

$
0
0

@sid100158 wrote:

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.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles