Skip to content

strptime and non ISO date format

6 messages · Dirk Eddelbuettel, PIKAL Petr, antonio rodriguez +2 more

#
Dear all

I have a character vector of dates something like:

timevec<-c("15.5.2003 00:00", "15.5.2003 00:01", "15.5.2003 00:02", 
"15.5.2003 00:03","15.5.2003 00:04")

and I would like to transform it to some more convenient date class. Is there a 
way how to do it directly without previous reformating to ISO like structure and 
adding a seconds to it.

I tried direct transformation but it does not work as I expected (or as I 
understood from help pages :-).
[1] NA NA NA NA NA

Thank you for any hint.

Best regards.

Petr Pikal
petr.pikal at precheza.cz
p.pik at volny.cz
#
On Fri, May 16, 2003 at 01:36:04AM +0200, Petr Pikal wrote:
You have the month and day mixed up, and also asked for two-digit year when
you really have four digits. Correcting both of these does the trick:

edd at chibud:~> R --silent
+ "15.5.2003 00:03","15.5.2003 00:04")
[1] "2003-05-15 00:00:00" "2003-05-15 00:01:00" "2003-05-15 00:02:00"
[4] "2003-05-15 00:03:00" "2003-05-15 00:04:00"

Hth, Dirk
#
Thank to Dirk and Patrick. I need to read help pages more 
carefully next time.
On 15 May 2003 at 19:24, Dirk Eddelbuettel wrote:

            
Petr
petr.pikal at precheza.cz
p.pik at volny.cz
#
Hi,

On WinXP, with R1.7.0 I've got the following messages when trying to install
(from CRAN or local file) the dse package:

Error in file(file, "r") : unable to open connection
In addition: Warning message:
cannot open file `dse/DESCRIPTION'

Thanks in advance


Antonio Rodriguez
#
This is a known bug in the R v1.7.0 release that occurs when using
install.packages()/update.packages() to install *bundles* and is
probably already fixed in the patch and the next version. Here is a work
around for now

 
source("http://www.maths.lth.se/help/R/patches/rw1070/install.packages.R
")

Cheers

Henrik Bengtsson
Lund University
#
dse is a bundle, and rw1070 can't install bundles.  What you can do is 
download the file and unzip it into the library directory (using 
zip.unpack if you like).
On Fri, 16 May 2003, antonio rodriguez wrote: