R table column order when including the empty string

Posted by Libo Cannici on Stack Overflow See other posts from Stack Overflow or by Libo Cannici
Published on 2010-06-17T15:41:13Z Indexed on 2010/06/17 15:43 UTC
Read the original article Hit count: 165

Filed under:

I have a series of value that include the empty string

levels(mydata$phone_partner_products) "" "dont_know" "maybe_interesting"
"not_interesting" "very_interesting" "very_not_interesting"

If I make a frequencies table I get this table(mydata$phone_partner_products)

                            dont_know    maybe_interesting 
            3752                  226                 2907 
 not_interesting     very_interesting very_not_interesting 
            1404                 1653                 1065

How can I reorder the columns in a more meaningful way? How can I rename the empty string "" level?

Thank you a lot in advance.

© Stack Overflow or respective owner

Related posts about r