NIEHS / GeoTox

Open-source software for connecting spatiotemporal exposure to individual and population-level risk
https://niehs.github.io/GeoTox/
Other
3 stars 0 forks source link

Going Object Oriented #33

Closed kyle-messier closed 3 months ago

kyle-messier commented 7 months ago

@SkylarMarvel I know we had this object oriented discussion last time we met. After going through the new vignettes and writing my presentation, I think there could be a lot of value in a formal S4 object oriented approach.

First, I think if we create a new object on top of the sf package that adds GeoTox type fields to an sf object, then it would create a lot of extensibility to further classes based on sf:

  1. sf Making it based off sf should in theory make it easy to have the population level where the sf objects keep track of the spatial boundary. Moreover, an sf point object could represent an individual where their spatial location is static.
  2. sftime - extension into space and time whether it be S-T areas or points
  3. sftrack - this package extension of sf tracks an object over time. I imagine this could be useful for agent-based-models, etc.
  4. sf has conversions for other S-T formats that could be useful down there road. The key is that I see this as a way to have future extensibility.

Second, we could write a lot of methods which are currently helper scripts not part of the package. For example, the make_county_heatmap and the resp_df series that ends in a call st_as_sf.