ronkeizer / vpc

R library to create visual predictive checks (VPC)
Other
36 stars 20 forks source link

move to object oriented system #4

Closed dpastoor closed 3 months ago

dpastoor commented 9 years ago

Given the long term objective is to make this (somewhat) software agnostic, switching to an object oriented system will probably reduce a lot of headache rather than massive ifelse chains. It will require some reorg but is definitely feasible. The two options I see are the S4 system or the R6 system

S4 pros/cons

R6 classes

I think either one would be completely sufficient for our means (performance bottlenecks due to object creation, etc will not be an issue), but personally take the opportunities to 'look forward' whenever possible.

Todos:

dpastoor commented 9 years ago

hmm nevermind R6 (and reference classes) are a whole separate beast - especially in regards to being mutable, probably will want to stick with just S3 or S4

ronkeizer commented 9 years ago

My experiences with S4 are not so positive. When I added some functionality to Xpose 2 years ago, I felt it really slowed me down, it took time to get used to and doesn't provide that much benefit over S3. So I prefer to stick to S3. It's much simpler and since the vpc-package in essence is meant to be fairly simple it should be enough to get the work done. Hadley also seems to like S3: http://adv-r.had.co.nz/OO-essentials.html#picking-a-system

dpastoor commented 9 years ago

Yeah I actually was thinking this morning before I saw your post that these will be so simple we don't need the overhead. Agree on S3.

billdenney commented 3 years ago

This appears to be mostly complete since vpc() is S3 generic, I think. It can probably be closed.