[R] histogram of time-stamp data

e-letter inpost at gmail.com
Tue Jul 17 08:11:37 CEST 2012


On 16/07/2012, Rui Barradas <ruipbarradas at sapo.pt> wrote:
> Hello,
>
> Em 16-07-2012 22:45, e-letter escreveu:
>> On 16/07/2012, r-help-request at r-project.org
>>   <r-help-request at r-project.org> wrote:
>>   > ------------------------------
>>   >
>>   > Message: 77
>>   > Date: Mon, 16 Jul 2012 10:48:39 +0100
>>   > From: Rui Barradas <ruipbarradas at sapo.pt>
>>   > To: e-letter <inpost at gmail.com>
>>   > Cc: r-help at r-project.org
>>   > Subject: Re: [R] histogram of time-stamp data
>>   > Message-ID: <5003E377.3000604 at 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'.



More information about the R-help mailing list