2016-04-30 194 views

回答

1

試試這個:

library(ggplot2) 

# Random data 
mat <- matrix(sample(1:100, size = 1000, replace = T), ncol = 2) 
colnames(mat) <- c("Run1Seek", "Run2Seek") 

# Make data frame 
ds <- data.frame(ID = 1:500, mat) 

# Melt to long format 
ds <- reshape2::melt(ds, "ID") 

# Look at data 
head(ds) 

# Plot 
ggplot(ds, aes(x = ID, y = value, fill = variable)) + geom_bar(stat = "identity") 
相關問題