【发布时间】:2015-05-28 22:57:11
【问题描述】:
我希望在如何使用 plan 包创建甘特图方面获得一些帮助。该包在前面的综合帖子several approaches using R; see answer 4 of 7 for plan中简要提到过,我的可重现数据如下。
dput(project)
structure(list(key. = structure(1:8, .Label = c("1,", "2,", "3,",
"4,", "5,", "6,", "7,", "8,"), class = "factor"), description. = structure(1:8, .Label = c("recommendation1,",
"recommendation2,", "recommendation3,", "recommendation4,", "recommendation5,",
"recommendation6,", "recommendation7,", "recommendation8,"), class = "factor"),
start. = structure(1:8, .Label = c("10/1/2015,", "10/2/2015,",
"10/3/2015,", "10/4/2015,", "10/5/2015,", "10/6/2015,", "10/7/2015,",
"10/8/2015,"), class = "factor"), end. = structure(1:8, .Label = c("12/1/2015,",
"12/2/2015,", "12/3/2015,", "12/4/2015,", "12/5/2015,", "12/6/2015,",
"12/7/2015,", "12/8/2015,"), class = "factor"), done. = c(90,
30, 0, 0, 0, 0, 0, 0), neededby = c(0, 0, 0, 0, 0, 0, 0,
0)), .Names = c("key.", "description.", "start.", "end.",
"done.", "neededby"), row.names = c(NA, -8L), class = "data.frame")
使用read.gantt(),数据框对我来说看起来不错:
> project
key. description. start. end. done. neededby
1 1, recommendation1, 10/1/2015, 12/1/2015, 90 0
2 2, recommendation2, 10/2/2015, 12/2/2015, 30 0
3 3, recommendation3, 10/3/2015, 12/3/2015, 0 0
4 4, recommendation4, 10/4/2015, 12/4/2015, 0 0
5 5, recommendation5, 10/5/2015, 12/5/2015, 0 0
6 6, recommendation6, 10/6/2015, 12/6/2015, 0 0
7 7, recommendation7, 10/7/2015, 12/7/2015, 0 0
8 8, recommendation8, 10/8/2015, 12/8/2015, 0 0
但是当我使用 print(summary() 时出现问题。最后两行有问题。我尝试在 .csv 文件中重写它们,但无济于事。
> print(summary(project))
key. description. start. end. done. neededby
1, :1 recommendation1,:1 10/1/2015,:1 12/1/2015,:1 Min. : 0.0 Min. :0
2, :1 recommendation2,:1 10/2/2015,:1 12/2/2015,:1 1st Qu.: 0.0 1st Qu.:0
3, :1 recommendation3,:1 10/3/2015,:1 12/3/2015,:1 Median : 0.0 Median :0
4, :1 recommendation4,:1 10/4/2015,:1 12/4/2015,:1 Mean :15.0 Mean :0
5, :1 recommendation5,:1 10/5/2015,:1 12/5/2015,:1 3rd Qu.: 7.5 3rd Qu.:0
6, :1 recommendation6,:1 10/6/2015,:1 12/6/2015,:1 Max. :90.0 Max. :0
(Other):2 (Other) :2 (Other) :2 (Other) :2
无论如何,我运行了plot(),结果显然很奇怪。
【问题讨论】:
标签: r gantt-chart