如何更改ddply语句的计数范围?

时间:2014-12-05 14:53:18

标签: r count scale plyr

我想更改计数比例(我称之为聚合),因为到目前为止,比例只有2.5,5.0,7.5等值。但事实上,结果只是整数,即1,2,3,4。所以,我想要一个表示这种情况的比例,但我不知道如何解决它。这是我的代码:

test_fifty <- xmlParse(fifty)
vc2 = as.numeric(test_fifty['//*[@name = "VertexConnectivity2"]', fun = function(x) xmlGetAttr(x, "result")])
number = as.numeric(test_fifty['//*[@name = "NumVNodesPerNet"]', fun = function(x) xmlGetAttr(x, "value")])
vc0 = as.numeric(test_fifty['//*[@name = "VertexConnectivity0"]', fun = function(x) xmlGetAttr(x, "result")])

df2 <- data.frame(number,vc2)
df0 <- data.frame(number,vc0)
qrange50 <- range(0,vc2,vc0)


df1_summary = ddply(
  df0,
  .(number, vc0),
  summarize,
  count=length(vc0)
)

p2 <-
ggplot(df1_summary, aes(number, vc0, size=count)) +   
  geom_point() + scale_x_continuous(breaks = c(6,7,8,9,10,11,12,13,14,15,16,17)) + scale_size_area("Aggregation") + xlab("Number of Virtual Vertices") + ylab("Vertex Connectivity") +
  ggtitle("Substrate Network Vertex Connectivity Aggregation (size = 50)") 

0 个答案:

没有答案