Thanks, yes, I would like to do it in one try.

I a have a text file called archivo where every line is like that:

"2007-12-03 13:50:17 Juan Perez"

("yy-mm-dd hh:mm:ss First Name Second Name")

My code is it:

datos <- read.delim(archivo,header=FALSE,sep= " ",dec=".",
        col.names=c("date","time","fname", "sname",comment="#",
        colClasses = c("character","character","numeric","numeric"))
f_h <- paste(datos[,"date"],datos[,"time"],sep=" ")
fecha_hora <- strptime(f_h, "%y-%m-%d %H:%M:%S")

Bye,

Sebastián.

______________________________________________
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.

Reply via email to