关于package plan制作的甘特图的问题
Questions regarding gantt chart produced by package plan
我希望在如何使用 plan
包创建甘特图方面得到一些帮助。该包在前面的综合post中简要提及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()
结果显然很奇怪。
我是名为 plan
的 R 包的作者。通常问题是在包裹的 issue page 上提出的,我认为这限制了听众,但有一个好处是在被问到问题时给我发电子邮件。
无论如何,为甘特图构造数据的正常方法是使用名为 read.gantt()
的函数。要获取有关该功能的文档,请尝试
library(plan)
?read.gantt
请注意,格式有严格的规定。它必须是纯文本文件,而不是 csv,当然也不是 xls。使用简单的文本编辑器对其进行编辑。如果我是你,我会从你写 project
时放在上面的输出开始,它告诉你列。 Cut/paste 将其转换为纯文本文件(可能命名为 "plan.txt",但名称无关紧要)。然后根据 read.gantt()
的文档调整标题等。然后只需阅读并绘制它。了解格式和查看输出的最快方法可能是查看包附带的小插图。在 R 中,输入
vignette("plan")
你会明白的。我在这条消息的底部放了一张小插图页面的快照。在 SO 上可能很难阅读,但只需 运行 上面的命令并跳到第 4 页即可查看。
如果您精通文本编辑器,这只需几分钟即可完成。但请注意,数据格式非常 严格,因此您可能需要使用一些花哨的编辑器技巧,例如移动列。
可以使用 R 命令将您的数据强制转换为格式,但从您上面所写的内容来看,您似乎对 R 还很陌生,最好坚持更简单的路径准备数据和运行宁标准 R 命令。
如果您需要更多帮助,请告诉我。 (再说一次,我不定期阅读 SO,所以除非 SO 通知我对此的后续行动,除非你给我发电子邮件,否则我不会收到回复。...这就是为什么最好在 plan
当然是网站。)
我希望在如何使用 plan
包创建甘特图方面得到一些帮助。该包在前面的综合post中简要提及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()
结果显然很奇怪。
我是名为 plan
的 R 包的作者。通常问题是在包裹的 issue page 上提出的,我认为这限制了听众,但有一个好处是在被问到问题时给我发电子邮件。
无论如何,为甘特图构造数据的正常方法是使用名为 read.gantt()
的函数。要获取有关该功能的文档,请尝试
library(plan)
?read.gantt
请注意,格式有严格的规定。它必须是纯文本文件,而不是 csv,当然也不是 xls。使用简单的文本编辑器对其进行编辑。如果我是你,我会从你写 project
时放在上面的输出开始,它告诉你列。 Cut/paste 将其转换为纯文本文件(可能命名为 "plan.txt",但名称无关紧要)。然后根据 read.gantt()
的文档调整标题等。然后只需阅读并绘制它。了解格式和查看输出的最快方法可能是查看包附带的小插图。在 R 中,输入
vignette("plan")
你会明白的。我在这条消息的底部放了一张小插图页面的快照。在 SO 上可能很难阅读,但只需 运行 上面的命令并跳到第 4 页即可查看。
如果您精通文本编辑器,这只需几分钟即可完成。但请注意,数据格式非常 严格,因此您可能需要使用一些花哨的编辑器技巧,例如移动列。
可以使用 R 命令将您的数据强制转换为格式,但从您上面所写的内容来看,您似乎对 R 还很陌生,最好坚持更简单的路径准备数据和运行宁标准 R 命令。
如果您需要更多帮助,请告诉我。 (再说一次,我不定期阅读 SO,所以除非 SO 通知我对此的后续行动,除非你给我发电子邮件,否则我不会收到回复。...这就是为什么最好在 plan
当然是网站。)