Here's a practical challenge for my fellow R loving TS'ers. I'm going to tackle it tomorrow, and I have some ideas. I thought it could be fruitful to see how others might approach it, though.
I need to grab some unemployment data, and frankly I'd like to keep all of it (and manipulate it accordingly once it's in R), but I only really need is the FIPS (state and county combined) and the unemployment level and rate (or at least level. I'm going to do a dot map in ArcGIS). I also need year as I'm going to combine a decade's worth of these files.
All of the files follow the format of this example.
I'm thinking of putting together a widths vector (tedious, but once it is done, it's done!), and using read.fwf with url while looping through a vector 90:99 (the years of my study) that pastes together the URL for each grab, combining the files into one large decade file. I could do something with scan or readLines, as they are more primitive (low-level), but I think read.fwf is sufficient, if not slow as all hell. Otherwise, something like readLines with strsplit and some fancy regex should do the job, but definitely be a bit more complicated!
What say you?
I need to grab some unemployment data, and frankly I'd like to keep all of it (and manipulate it accordingly once it's in R), but I only really need is the FIPS (state and county combined) and the unemployment level and rate (or at least level. I'm going to do a dot map in ArcGIS). I also need year as I'm going to combine a decade's worth of these files.
All of the files follow the format of this example.
I'm thinking of putting together a widths vector (tedious, but once it is done, it's done!), and using read.fwf with url while looping through a vector 90:99 (the years of my study) that pastes together the URL for each grab, combining the files into one large decade file. I could do something with scan or readLines, as they are more primitive (low-level), but I think read.fwf is sufficient, if not slow as all hell. Otherwise, something like readLines with strsplit and some fancy regex should do the job, but definitely be a bit more complicated!
What say you?