#1 delete column or array comprised of the same element
md<-matrix(data=c(4,4,4,4,4,4,4,2,3,4,5,6,4,4,4,4,4,4,4,4,5,6,7,8),
           nrow=4,ncol=6,byrow=TRUE)
md
#----------------------------
tt<-which(apply(md,1,sd)==0); tt
rd1<-md[-c(tt),]; rd1
#----------------------------
ss<-which(apply(md,2,sd)==0); ss
rd2<-md[,-c(ss)]; rd2
#2 delete the same columns 
mdataM<-matrix(c(1,1,3,1,1,2,4,4,6),ncol=3,nrow=3)
udataM<-unique(mdataM); dim(udataM)
mdataM; udataM
unique(mdataM[2,]); unique(mdataM[,2])