S3 and S4 Classes (R)

S3 and S4 are R's two main object-oriented systems. S3 is informal and uses a class attribute plus generic functions; S4 is formal with declared slots…