How to extract unique elements from data.frame in R?
Can anyone suggest a way to extract unique elements from a data.frame?
I noticed unique
, but since it works on any rows or columns, it doesn't do what I'm looking for. I am behind unique cells from data.frame.
eg.
df<-data.frame(V1=c("Hello","fat","man"),V2=c("cat","fat","Hello"),V3=c("man","dog","black"))
Extracting unique items should give me c("Hello","fat","man","cat","dog","black")
+3
source to share