#1 delete columns containing NA data
md<-matrix(data=c(4,4,4,4,4,4,NA,2,3,4,5,6,4,4,NA,4,4,4,4,4,5,6,7,8),
           nrow=4,ncol=6,byrow=TRUE)
md
a1 <- na.omit(md)
a1
a2 <- md; a2[is.na(a2)] <- 0
a2
#2 delete arrays containing NA data
md2<-t(md); b1<-na.omit(md2); b2<-t(b1)
b2