Possible Duplicate:
Read csv with two headers into a data.frame
I am new to R and working to use R to analyse some data. The data happens to be in Excel format and right now I'm struggling to find a way to convert it into a format that is R-friendly.
The issue is that the column headers have merged cells, so in effect the headers have two rows. I'd like to convert it into a normal set of 1-D vectors, add an extra column and a row. Let me explain with an example:
Currently the excel format looks thus:
| H | J |
Y |M |F |M |F |
== == == == ==
Y1|V1|V2|V3|V4|
H,J are merged column headers and each of them span columns M and F.
The = indicate that the rows above are header rows
Given that H,J both are elements under, say R, I would like to convert this into a columnar format with a normal header and two rows, like this
Y |R |M |F |
== == == ==
Y1|H |V1|V2|
Y1|J |V3|V4|
Does anyone have an idea how to do this?