[R] Import variable labels to data frame columns

From: AjayT <ajaytalati_at_googlemail.com>
Date: Sun, 27 Mar 2011 18:40:16 -0700 (PDT)

Hi, I'm new to R and I'm stuck trying to import some data from a .dat file I've been given. The tricky bit for me is that the data has both variable values and labels?

The data looks like this,

Id=1 time=2011-03-27 19:23:40 start=1.4018       end=1.4017   
Id=2 time=2011-03-27 19:23:40 start=1.8046       end=1.8047 
Id=1 time=2011-03-27 19:23:50 start=1.4017       end=1.4018   
Id=2 time=2011-03-27 19:23:50 start=1.8047       end=1.8046  

Is there a way to read the file into a dataframe or martix, so each line of the file is read into a row, and the data labels are the columns. I'm try to get it to look like this?

Id  time                          start      end
1  2011-03-27 19:23:40 1.4018  1.4017 
2  2011-03-27 19:23:40 1.8046  1.8047

1 2011-03-27 19:23:50 1.4017 1.4018
2 2011-03-27 19:23:50 1.8047 1.8046

Its driving me nuts . Any help appreciated

View this message in context: http://r.789695.n4.nabble.com/Import-variable-labels-to-data-frame-columns-tp3410525p3410525.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 28 Mar 2011 - 03:29:30 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 Mon 28 Mar 2011 - 06:50:25 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