Created
December 5, 2014 23:21
-
-
Save barryrowlingson/5464bb25fecfe735943b to your computer and use it in GitHub Desktop.
read some data file..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
readit = function(filename){ | |
lines = readLines(filename) | |
whichdata = grep("^[0-9]{4}",lines) | |
headers = read.table(textConnection(lines[min(whichdata)-1])) | |
datalines = lines[whichdata] | |
dmat = read.table(textConnection(datalines),na.strings=c("***","****")) | |
names(dmat)=t(headers)[,1] | |
dmat | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment