You might want to debug your data. Anytime there is an error message, take a look at your data. You have some illegal dates in your 'end' (2010/9/31 & 2010/6/31 are not legal and are probably causing your error). Simply printing out your test data would have shown that:
> gantt.info $labels [1] "First task" "Second task (1st part)" "Third task (1st part)" "Second task (2nd part)" "Third task (2nd part)" [6] "Fourt task" "Fifth task" "Sixth task" $starts [1] "2010-01-01 EST" "2010-07-01 EDT" "2010-10-01 EDT" "2011-04-01 EDT" "2011-07-01 EDT" "2011-07-01 EDT" "2012-01-01 EST" [8] "2012-07-01 EDT" $ends [1] "2010-06-30 EDT" NA "2011-03-31 EDT" NA "2011-12-31 EST" "2012-06-30 EDT" "2012-06-30 EDT" [8] "2012-12-31 EST" $priorities [1] 1 2 3 4 5 > On Sat, Feb 27, 2010 at 6:07 PM, Zoppoli, Gabriele (NIH/NCI) [G] <zoppo...@mail.nih.gov> wrote: > 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: zoppo...@mail.nih.gov > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.