Closed Robinlovelace closed 5 years ago
My approach these days is to avoid classes where possible. Presume most or all operations will be part of a tidy pipeline, so just make everything a simple tibble
and maybe insert a check for appropriate column structure rather than actual class. Having said that, both bikedata
and m4ra
now use class structures just to hold some meta-data, so i don't really practice what I preach here
I think it would be inefficient to have calendar metadata repeated in every row so using attributes seems to make sense. ical
objects will be data frames, as I imagine.
It's a tibble with attributes: https://github.com/ATFutures/ical/blob/master/R/ical.R
Any suggestions on improving this @mpadge ? As you'll see it's dead simple.
ical, an S3 class based on the data frame with attributes like sf objects do. Worth checking https://github.com/r-spatial/sf/blob/master/R/sf.R#L37