Skip to content
Prev 369729 / 398503 Next

Keep only those values in a row in a data frame which occur only once.

Hi Ashim,
One way is this, assuming that your data frame is named akdf:

akdf<-t(apply(akdf,1,function(x) return(unique(x)[1:length(x)])))

If you want factors instead of strings, more processing will be required.
Jim
On Mon, Jun 12, 2017 at 3:23 PM, Ashim Kapoor <ashimkapoor at gmail.com> wrote: