healthyregions / oepsData

An R package for easy access to the Opioid Environment Policy Scan (OEPS) datasets.
Creative Commons Attribution 4.0 International
1 stars 0 forks source link

Create basic load table function #3

Open mradamcox opened 1 month ago

mradamcox commented 1 month ago

We can provide different methods for curating the data loading process for users of this data package, and one of the best workflows we've discussed is to have a function that sits in the R directory, and is callable by anyone who has installed the package. This function could be something like:

oepsData::load(year=1990, spatial_resolution='tract', theme='environment', geom=TRUE)

This would return all of the variables from the 1990 tract CSV that fit the environment theme, and would also join spatial data to this frame along the way. As mentioned in #2, spatial data could potentially be loaded dynamically at the time of the join by referencing a remote url (I could see this being a performance issue, though, something to try out at least).

Further refinements would allow a state=IL filter, or something like that.