Skip to content

histogram

1 message · arun

#
Hi,

If you meant to get the array index from `res1`, then this will do it.? But, if it is from 'dat3`, it will? be huge as each index is unique.
indx<-which(apply(res1,1,function(x) x!=0) ,arr.ind=TRUE)
?Names2<-do.call(rbind,lapply(1:3,function(i) {x<-indx[indx[,2]==i,]; paste(apply(x,1,function(y) paste("(",paste(y,collapse=","),")",sep="")),collapse=",")} ))
?res2<- data.frame(Frequency=apply(res1,1,function(x) sum(1*(x!=0))), stations=Names2,stringsAsFactors=FALSE)

A.K.