Re: [R] extract date time from a text file

From: jim holtman <jholtman_at_gmail.com>
Date: Fri, 18 Jun 2010 12:30:54 -0400

You data has 4 fields (separated by blanks) and that is what you are reading. Just write some code to combine the fields:

newDF <- data.frame(time=as.POSIXct(paste(oldDF[[1]], oldDF[[2]]), name=paste(oldDF[[3]], oldDF[[4]]))

On Fri, Jun 18, 2010 at 10:58 AM, Sebastian Kruk <residuo.solow_at_gmail.com> wrote:
> I a have a text file where every line is like that:
>
> "2007-12-03 13:50:17 Juan Perez"
> ("yy-mm-dd hh:mm:ss First Name Second Name")
>
> I would like to make a data frame with two column one for date and the
> other one for name.
>
> When I use read.delim it was transformed in a data frame with 4 colums.
>
> Bye,
>
> Sebastián.
>
> ______________________________________________
> R-help_at_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.
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

______________________________________________
R-help_at_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.
Received on Fri 18 Jun 2010 - 16:36:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Jun 2010 - 17:00:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive