ATFutures / calendar

R interface to iCal (.ics files)
https://atfutures.github.io/calendar/
Other
38 stars 10 forks source link

Define calender class #5

Closed Robinlovelace closed 5 years ago

Robinlovelace commented 5 years ago

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

mpadge commented 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

Robinlovelace commented 5 years ago

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.

Robinlovelace commented 5 years ago

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.