[R] convert 12 time stamp to 24 hour

PIKAL Petr petr.pikal at precheza.cz
Mon Feb 11 15:33:17 CET 2013


Hi

> -----Original Message-----
> From: e-letter [mailto:inpost at gmail.com]
> Sent: Monday, February 11, 2013 3:11 PM
> To: PIKAL Petr
> Cc: r-help at r-project.org
> Subject: Re: [R] convert 12 time stamp to 24 hour
> 
> On 11/02/2013, PIKAL Petr <petr.pikal at precheza.cz> wrote:
> >
> > str(testtimedataset)
> 
> With my real data set, revealed that after conversion, the time series
> data consists of 'chr' which I guess means character type data,

Do not guess. There is extensive help in R which you can ivoke by"?".

?mode
?typeof

> reporting the following error:
> 
> Error in plot.window(...) : need finite 'xlim' values In addition:
> Warning messages:
> 1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
> 2: In min(x) : no non-missing arguments to min; returning Inf
> 3: In max(x) : no non-missing arguments to max; returning -Inf
> 
> 
> Does this mean I must convert the 24-hour time series values to POSIX*t

Yes.

> type objects; if so how please?

?strptime

Regards
Petr

> >
> > Anyway, by
> >
> > plot(testdata~testtimedataset$V1)
> >
> > you will get rid of error message but depending on testtimedataset
> > mode you can get different one.
> >
> 
> Confirmed, thanks.


More information about the R-help mailing list