Skip to content

Instantly share code, notes, and snippets.

@aurielfournier
Created March 17, 2017 15:13
Show Gist options
  • Save aurielfournier/b3e55425c6d55ce6dc3986c105af5181 to your computer and use it in GitHub Desktop.
Save aurielfournier/b3e55425c6d55ce6dc3986c105af5181 to your computer and use it in GitHub Desktop.
dat <- data.frame(A=c(1,2,3,4,5,6), B=c("Dog","Cat","Bird"))
dat2 <- dat[dat$B!="Bird",]
uni <- unique(dat2$B)
dat2$B <- factor(dat2$B, levels=uni)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment