Main differences are:
- All the initial data acquisition & munging is kept in one pipeline and the data structure is kept as a
tbl_df
- I ended up having to use
html_session
since the site was rejecting the access (login req'd) w/o it - The
for
loop is now anapply
iteration andpbapply
gives you a progress bar for free which is A Good Thing given how long that operation took :-) - The move to
pbapply
makes it possible to do the row-binding and left-joining in a single pipeline, which keeps everything in atbl_df
. - Your
for
solution can be made almost as efficient if you do aimg_list <- vector("list", 150)
so the list size is pre-allocated.
BTW: the popup
code is brilliant and tigris
is equally as brilliant!
This code is so clean just wanted to say nice!!!