[英]Plot multiple obs. of 1 variables using ggplot2 in R
我是一个数据集,其矩阵按以下multiple obs. of 1 variables
分隔multiple obs. of 1 variables
multiple obs. of 1 variables
:
>GC_percent
[1,] 0.4835822
[2,] 0.4782782
[...]
[5622,] 0.4968492
[5623,] 0.5076531
我将用这个绘制一个直方图:
qplot(GC_percent, geom="histogram")
但是不可避免地它不起作用:
Error: ggplot2 doesn't know how to deal with data of class matrix
正如Roland所说,ggplot2需要一个数据框:
GC_percent <- as.data.frame(GC_percent)
qplot(GC_percent, geom="histogram")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.