When does it pay off to use S4 methods in R programming

前端 未结 7 1302
不知归路
不知归路 2020-12-12 13:55

I program regularly in R in a professional context, and I write packages for clients or co-workers as well. Some of the programmers here have a Java background and insist on

相关标签:
7条回答
  • 2020-12-12 14:27

    I learnt S4 in order to extend the Spatial (sp) classes for animal track data. It was the best choice (most consistent, general and closely matching to many GIS definitions) from the available options to avoid writing everything required from scratch. I don't find S4 as onerous as many people say, but I'm now used to exploring the underlying structure of objects like this. The performance is good too, I think it can be done well, though when done poorly there are performance traps.

    If spatial data is of interest to you, spatstat is a good example of how to do a lot of similar things to sp in S3, though (as with seemingly everything spatial . . .) there's hardly ever clean analogies between data structures in different softwares.

    0 讨论(0)
提交回复
热议问题