I have a large datafile of 1000 subjects and 50 variables per subject in Excel but the headers truncated to the middle of the file when the datafile was uploaded into the R statistical program.
If you've saved it as a tab-delimited text file, then the "read.delim" function should handle this well. But check your headers for special characters (apostrophes, colons, etc) since sometimes these can cause problems.
depending on the command with which you read the data into R, you also need to get rid of spaces within header text, AND within the data themselves - replace them with an underscore or NA, whichever is applicable
I always put my data into a .txt file for R. It works for >1 line of headers, but may not be the most intuitive for the amount of data that you have. You may want to give it a try. As others have said, make sure each header contains no spaces.
The question says "headers" (plural) so if this is a case with header info followed by tabular data, followed by more header info and more tabular ... well, then, you'll need to do things semi manually, using "read.table(..., skip=..., nrows=...)" with skip and nrows set as appropriate to the first data chunk, followed by a similar command for each chunk.
This sort of problem arises not uncommonly with excel data, because people may create whatever they want in any given cell, i.e. header or data or data followed by header, etc. I have seen many excel spreadsheets that can only be decoded by the human eye (followed in R by the scheme in the previous paragraph). I've seen others that are basically not decodable except by the author, who remembers what each cell means.
Think of excel data as laboratory notes. One is free to write whatever is desired, wherever one chooses. There need not be any rhyme or reason to it. If you only have one file, just dump it to CSV and hand edit to get it into a simple form (header followed by data), then load in R and proceed.
If you have thousands of files, and if every file is the same, you may be able to invent an algorithm (e.g. something in the header may indicate how many data you have). If every file is different, you are going to have to spend some time either coding or hand editing.
The good thing is you'll learn how bad excel is for data storage, and maybe you'll spread the word.
Further details regarding the way you transferred the data would be helpful. So I can only comment in a more general way by hinting you to packages like:
gdata
xlsx
XLConnect
and
RODBC
These packages support native reading of excel-sheets. Maybe they could help you?