Re: [R] converting to POSIXct

2021-11-30 Thread Stefano Sofia
...@regione.marche.it ---Oo-oO Da: PIKAL Petr [petr.pi...@precheza.cz] Inviato: martedì 30 novembre 2021 12.45 A: Duncan Murdoch; Jim Lemon Cc: r-help mailing list; Stefano Sofia Oggetto: RE: [R] converting to POSIXct Hi

Re: [R] converting to POSIXct

2021-11-30 Thread PIKAL Petr
Duncan Murdoch > Sent: Tuesday, November 30, 2021 12:05 PM > To: Jim Lemon ; PIKAL Petr > > Cc: r-help mailing list ; Stefano Sofia > > Subject: Re: [R] converting to POSIXct > > On 30/11/2021 3:41 a.m., Jim Lemon wrote: > > Hi, > > Petr is right. Apparently a

Re: [R] converting to POSIXct

2021-11-30 Thread Duncan Murdoch
On 30/11/2021 3:41 a.m., Jim Lemon wrote: Hi, Petr is right. Apparently as.POSIXct drops the smallest increments if all are zero: That's not as.POSIXct doing anything: there's no way to drop increments, the POSIXct format records a number of seconds and that can't be changed. What is happe

Re: [R] converting to POSIXct

2021-11-30 Thread Jim Lemon
Hi, Petr is right. Apparently as.POSIXct drops the smallest increments if all are zero: ssdf<-read.csv(text="data_POSIX,Sensor_code,value 2002-11-01 00:00:01,1694,7.2 2002-11-01 00:00:00,1723,10.8", stringsAsFactors=FALSE) ssdf$data_POSIX<-as.POSIXct(ssdf$data_POSIX,"%Y-%m-%d HH:MM:SS") ssdf

Re: [R] converting to POSIXct

2021-11-30 Thread PIKAL Petr
Hi You probably has zero hours in all your data see > temp data_POSIX Sensor_code value 1 2002-11-01 00:00:001694 7.2 2 2002-11-01 00:00:001723 10.8 without hours > as.POSIXct(temp$data_POSIX, format = "%Y-%m-%d %H:%M:%S", tz="Etc/GMT-1") [1] "2002-11-01 +01" "2002-