I have a data frame:  

--X Y Z

A 1 2 3

B 0 0 1

C 0 1 0

I want to extract row and column name of the cell from the data frame where the value of that cell is greater than 0 and store the value, row and column name to another data frame which I created and is empty.

mP3 <- data.frame()

I tried :mp3<- which(rownames(df[,] > 0))

but it has not worked. Any help is appreciated