Hi all I wish to draw an histogram... with dates but the following append, i don't know where is the problem, help(hist.Date) works and i don't see any usefull information on what i'm doing wrong...> hist.Date(dt_cycles)Error: couldn't find function "hist.Date"> hist.date(dt_cycles)Error: couldn't find function "hist.date"> cycles[1] 7 1 2 5 14 5> dt_cyclesdates_releves cycles 1 2005-07-01 7 2 2005-07-04 1 3 2005-07-06 2 4 2005-07-11 5 5 2005-07-25 14 6 2005-07-27 5> dates_releves<-as.Date(dates_releves) > hist(dates_releves,cycles)Error in hist.Date(dates_releves, cycles) : invalid specification of 'breaks'> hist(dates_releves~cycles)Error in hist.default(dates_releves ~ cycles) : 'x' must be numeric>Any ideas would be great... thks guillaume.
hist.Date is not exported from its namespace. Try RSiteSearch('namespace') to learn more about this (look for the R News article). As you saw, hist() will dispatch hist.Date() when it is given a date-time argument. Read the docs again -- you failed to specify the breaks = ... argument properly. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA "The business of the statistician is to catalyze the scientific learning process." - George E. P. Box> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of > herodote at oreka.com > Sent: Tuesday, October 18, 2005 8:37 AM > To: r-help > Subject: [R] hist of dates > > Hi all > > I wish to draw an histogram... with dates but the following > append, i don't know where is the problem, help(hist.Date) > works and i don't see any usefull information on what i'm > doing wrong... > > > hist.Date(dt_cycles) > Error: couldn't find function "hist.Date" > > hist.date(dt_cycles) > Error: couldn't find function "hist.date" > > cycles > [1] 7 1 2 5 14 5 > > dt_cycles > dates_releves cycles > 1 2005-07-01 7 > 2 2005-07-04 1 > 3 2005-07-06 2 > 4 2005-07-11 5 > 5 2005-07-25 14 > 6 2005-07-27 5 > > dates_releves<-as.Date(dates_releves) > > hist(dates_releves,cycles) > Error in hist.Date(dates_releves, cycles) : > invalid specification of 'breaks' > > hist(dates_releves~cycles) > Error in hist.default(dates_releves ~ cycles) : > 'x' must be numeric > > > > Any ideas would be great... > thks > guillaume. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
Pleae see ?hist.Date for how to use it, as you usage is nothing like the examples there. However, I suspect you do not want a histogram but a barplot, as in with(dt_cycles, barplot(cycles, names=as.character(dates_releves))) (You may want to adjust the font size or date format. On Tue, 18 Oct 2005, herodote at oreka.com wrote:> Hi all > > I wish to draw an histogram... with dates but the following append, i > don't know where is the problem, help(hist.Date) works and i don't see > any usefull information on what i'm doing wrong... > >> hist.Date(dt_cycles) > Error: couldn't find function "hist.Date" >> hist.date(dt_cycles) > Error: couldn't find function "hist.date" >> cycles > [1] 7 1 2 5 14 5 >> dt_cycles > dates_releves cycles > 1 2005-07-01 7 > 2 2005-07-04 1 > 3 2005-07-06 2 > 4 2005-07-11 5 > 5 2005-07-25 14 > 6 2005-07-27 5 >> dates_releves<-as.Date(dates_releves) >> hist(dates_releves,cycles) > Error in hist.Date(dates_releves, cycles) : > invalid specification of 'breaks' >> hist(dates_releves~cycles) > Error in hist.default(dates_releves ~ cycles) : > 'x' must be numeric >> > > Any ideas would be great... > thks > guillaume.-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595