I am having trouble reading a large .dat file into R.
I am using
data <- read.table("...2018029_ascii/FRSS108PUF.dat", fill=TRUE)
This results in a large dataframe with V1, V2 as column names.
I am using the ASCII file at this link: https://nces.ed.gov/pubsearch/pubsinfo.asp?pubid=2018029
"...nameoffolder/2018029_ascii/FRSS108PUF.dat"
That is not a "something"-delimited file, it's fixed width.
The hard part about fixed-width formats is determining the widths of each field. Fortunately (somewhat), the documentation zip has
LayoutPUF.pdfthat contains each field and the columns for each.The widths for that file should total 1441, since that's what we're getting from the file:
Counting up the columns, we can use
Over to you to name all 253 columns. You can transcribe from the pdf (you might be able to scrape it, but that doesn't look like an awesome scrape-able pdf), starting with something like
It will be laborious, no doubt.
Edit: try this.
If you need the questions themselves, you may be able to get some of it from the
nmsobject (somesubstringmight be useful), though the filtering will leave many of those sentences incomplete.