Say I have a dataframe where the rows correspond to samples and each column corresponds to how often some molecule appears in the sample. How do I create a plot so that each molecule name is on the x axis and how often it appears in each sample on the y axis.
For example:
temp <- data.frame(mol1 = c(0.2,0.3,0.5),
mol2 = c(0.4,0.7,0.3),
mol3 = c(0.1, 0, 0.8))
rownames(temp) <- c("S1", "S2", "S3")
There would be a tick for "mol1" on the x-axis with the values 0.2, 0.3, and 0.5 above it labeled or with a legend. The same for the other molecules.
question from:
https://stackoverflow.com/questions/65713088/plotting-rows-vs-columns-in-r 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…