Skip to content

Instantly share code, notes, and snippets.

@nassimhaddad
Created February 4, 2013 18:41
Show Gist options
  • Save nassimhaddad/4708636 to your computer and use it in GitHub Desktop.
Save nassimhaddad/4708636 to your computer and use it in GitHub Desktop.
reorder factor levels. change the order of factors without changing their value
df$g <- factor(df$g, levels = letters[4:1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment