On 16/07/2012, Rui Barradas <ruipbarra...@sapo.pt> wrote: > Hello, > > Em 16-07-2012 22:45, e-letter escreveu: >> On 16/07/2012, r-help-requ...@r-project.org >> <r-help-requ...@r-project.org> wrote: >> > ------------------------------ >> > >> > Message: 77 >> > Date: Mon, 16 Jul 2012 10:48:39 +0100 >> > From: Rui Barradas <ruipbarra...@sapo.pt> >> > To: e-letter <inp...@gmail.com> >> > Cc: r-help@r-project.org >> > Subject: Re: [R] histogram of time-stamp data >> > Message-ID: <5003e377.3000...@sapo.pt> >> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> > >> > >> > timestamps <- as.POSIXct(Sys.Date()) + sample(24*60*60, 1e3, TRUE) >> > >> >> Why is it necessary to apply the sample to the current date? Looking >> at the dataframe, I noticed that values have been changed: > > No! That instruction is just to create a data example with more > date/time values, in this case with a total of 1e3 different values. > What's important is the way to plot the histogram, namely, the cut() > with two example time periods, and that hist() needs numbers, not cut's > levels. >
With the original data provided, R reports an error, that "'x' must be numeric'. ______________________________________________ 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.