I currently have the following data framework:
datnotformeanfill<-
data.frame(b8=c(1,2,2,2,1,1),b7=rep(1,6),
b6=c(6,2,3,3,6,3),b5=c(6,3,3,3,4,3),
b4=c(rep(6,5),1),b3=rep(0,6),
b2=rep(1,6),b1=c(2,2,2,2,1,1))
> datnotformeanfill
b8 b7 b6 b5 b4 b3 b2 b1
1 1 1 6 6 6 0 1 2
2 2 1 2 3 6 0 1 2
3 2 1 3 3 6 0 1 2
4 2 1 3 3 6 0 1 2
5 1 1 6 4 6 0 1 1
6 1 1 3 3 1 0 1 1
I am trying to use a combination of functions whichand uniqueto return only columns that have more than one unique value, but I'm not quite sure how to use them (or perhaps some other functions (s)) to return columns. Any help would be greatly appreciated. Thank!
source
share