Try this: hist(as.Date(dts), "days") # or "weeks" or "months"
On 6/23/06, Bojanowski, M.J. (Michal) <[EMAIL PROTECTED]> wrote: > Hello dear useRs and wizaRds, > > I encountered the following problem using the hist() method for the > 'times' classes > from package 'chron'. You should be able to recreate it using the code: > > > > library(chron) > > # pasted from chron help file (?chron) > dts <- dates(c("02/27/92", "02/27/92", "01/14/92", "02/28/92", > "02/01/92")) > class(dts) > > hist(dts) # which yields: > > # Error in axis(side, at, labels, tick, line, pos, outer, font, lty, > lwd, : > # 'label' is supplied and not 'at' > # In addition: Warning messages: > # 1: "histo" is not a graphical parameter in: plot.window(xlim, ylim, > log, asp, ...) > # 2: "histo" is not a graphical parameter in: title(main, sub, xlab, > ylab, line, outer, ...) > > > > The plot is produced, but there are no axes. > > As far as it goes for the warnings I looked in the sources and I think > they are caused > by hist.times() in package 'chron' which is calling the barplot() with > the histo=TRUE, > whereas neither barplot(), plot.window(), title() nor axis() seem to > accept this argument. > > Am I doing something wrong or there is something not right with the > hist.times method? > > > Kind regards, > > Michal > > > > > > PS: I'm using R 2.3.1 on Windows XP and: > > > > > sessionInfo() > Version 2.3.1 (2006-06-01) > i386-pc-mingw32 > > attached base packages: > [1] "methods" "stats" "graphics" "grDevices" "utils" > "datasets" > [7] "base" > > other attached packages: > chron > "2.3-3" > > > > > library(help="chron") > > Package: chron > Version: 2.3-3 > Date: 2006-05-09 > Author: S original by David James <[EMAIL PROTECTED]>, R > port by Kurt Hornik <[EMAIL PROTECTED]>. > Maintainer: Kurt Hornik <[EMAIL PROTECTED]> > Description: Chronological objects which can handle dates and times > Title: Chronological objects which can handle dates and times > Depends: R (>= 1.6.0) > License: GPL > Packaged: Fri May 12 09:31:49 2006; hornik > Built: R 2.3.0; i386-pc-mingw32; 2006-05-13 12:21:51; windows > > > > > > > ~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~`~,~ > > Michal Bojanowski > ICS / Utrecht University > Heidelberglaan 2; 3584 CS Utrecht > Room 1428 > [EMAIL PROTECTED] > > ______________________________________________ > R-help@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 > ______________________________________________ R-help@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