I basically have the same (unanswered) question as this fellow here -- I want to import the .raw data file at this link and convert the data within into a matrix/dataframe.
I downloaded redwt.raw to a folder, set my working directory to that folder, and followed the advice at the link above to import it via this code:
test <- readLines("redwt.raw", n = -1)
That works to create a character class object called test, where I can see my data. But I am not sure how to convert the data held within that object into a dataframe. The output should be a 2-column matrix; in it's current form, each odd column is an ID, and each even column is a corresponding sampling weight for the ID that came before it. So I'd like to loop through the numbers in the .raw file to create a ?x2 matrix dataframe.
That data looks really simple to import, many assumptions. Notable is that they are alternating pairs (and not rows of observations).
If the data looks like this:
Then we can do this: