Closed RWParsons closed 1 year ago
Thanks Rex, this looks good.
Agree that it would be cleaner to be able to download individual correspondence tables rather than the whole batch (an unexpected downside of the way I have structured it in absmapsdata
). But, given the manageable file size and the ability of the user to download and store the file at a specified path (rather than download each time), I think this is okay for now.
If it becomes a hassle in the future, we can lodge an issue and fix it on the absmapsdata
side.
In this branch I have:
read_correspondence_tbl()
which reads the correspondence tables from{absmapsdata}
in the same way asread_absmap()
does. I include tests for this similar to those forread_absmap()
and added myself as a ctb.Currently, the absmapsdata package stores all correspondence files together in the same sysdata.rda (https://github.com/wfmackey/absmapsdata/blob/master/R/sysdata.rda) file on GitHub. This means that
read_correspondence_tbl()
downloads all of these and then picks out the one that's requested. This isn't particularly efficient, though. If we wanted to make this a bit more streamlined, I could make a change to absmapsdata so that each of the correspondence tables are stored in separate .rda files and then only the selected one is downloaded and returned to the user. I don't think this is a biggie as I doubt people are repeatedly loading correspondence files in their workflows and the sysdata.rda file is only ~15MB. BUT, if you think this is preferable, I'm happy for this pull request to be rejected and make the change in absmapsdata.Thanks, Rex