Input file:
y <- read.table(textConnection('
c1 c2 c3
1 a b -1
2 a b -1
3 a c 1
4 a b 1
5 a b -1
'), header=TRUE)
thus, y is
c1 c2 c3
1 a b -1
2 a b -1
3 a c 1
4 a b 1
5 a b -1
the output file would be:
c1 c2 c3
1 a b -1
3 a c 1
4 a b 1
How to remove multiple or duplicate rows with same entry in all columns?
Try unique(y)
> unique(y)
c1 c2 c3
1 a b -1
3 a c 1
4 a b 1
?unique. Watch out for floating point variables though...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With