[R] help with Gantt chart
Zoppoli, Gabriele (NIH/NCI) [G]
zoppolig at mail.nih.gov
Sun Feb 28 00:07:53 CET 2010
Hi,
I don't know to solve this error that is returned, even though I understand it:
library(plotrix)
Ymd.format<-"%Y/%m/%d"
gantt.info<-list(labels=
c("First task","Second task (1st part)","Third task (1st part)","Second task (2nd part)","Third task (2nd part)",
"Fourt task","Fifth task","Sixth task"),
starts=
as.POSIXct(strptime(
c("2010/01/01","2010/07/01","2010/10/01","2011/04/01","2011/07/01","2011/07/01","2012/01/01","2012/07/01"),
format=Ymd.format)),
ends=
as.POSIXct(strptime(
c("2010/06/30","2010/09/31","2011/03/31","2011/06/31","2011/12/31","2012/06/30","2012/06/30","2012/12/31"),
format=Ymd.format)),
priorities=c(1,2,3,4,5))
vgridpos<-as.POSIXct(strptime(c("2010/01/01","2010/04/01","2010/07/01",
"2010/10/01","2011/01/01","2011/04/01","2011/07/01","2011/10/01",
"2012/01/01","2012/04/01","2012/07/01","2010/10/01"),format=Ymd.format))
vgridlab<-
c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
gantt.chart(gantt.info,main="My First AIRC Grant Gantt Chart",
priority.legend=TRUE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=TRUE)
Error in if (any(x$starts > x$ends)) stop("Can't have a start date after an end date") :
missing value where TRUE/FALSE needed
Thanks
Gabriele Zoppoli, MD
Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of Genova, Genova, Italy
Guest Researcher, LMP, NCI, NIH, Bethesda MD
Work: 301-451-8575
Mobile: 301-204-5642
Email: zoppolig at mail.nih.gov
More information about the R-help
mailing list