我有一个使用 ggplot2 打印和保存一些图表的功能。当我执行 geom_density 时,出现了错误消息。
Don't know how to automatically pick scale for object of type function. Defaulting to continuous
Error in data.frame(x = 1:5, y = c(44.43, 72.36, 177.17, 515.09, 1403.33 :
arguments imply differing number of rows: 5, 0
经过一番研究,我发现我可能错过了组名和一些说明。但是,我无法确定这个错误。我列出了全部数据。
library(ggplot2)
dt <- read.table("/R/10G.csv", header=TRUE, sep="\t", na.strings="NA", dec=".", strip.white=TRUE)
dt$Thread <- factor(dt$Thread) # factorize 'Thread'
library(plyr)
dd.mean <- ddply(dt, 'Thread', summarize, TPS = round(mean(TPS), 2), RT = round(mean(RT), 2))
m <- ggplot(dd.mean, aes(x=Thread,y=RT, group=seq))
m + geom_density(fill=NA)
m + geom_text(data=dd.mean, aes(x=Thread, label=TPS), vjust=-2)