datav<-c(1000,100,10,1,0.1,2000,200,20,2,0.2,3000,300,30,3,0.3,4000,400,40,4,0.4)
dataMatrix<- matrix(datav, nrow=5, ncol=4);  dataMatrix
#[1]
nc<-ncol(dataMatrix)
pdata<-apply(dataMatrix[,1:nc],1,function(x){x/sum(x)*100})
percentdata<-t(pdata); percentdata
#[2]
nc<-ncol(dataMatrix)
t(apply(dataMatrix[,1:nc],1,function(x){x/sum(x)*100}))
#[3]
t(apply(dataMatrix,1,function(x){x/sum(x)*100}))
