R-Programming Succinctly by Unknown

R-Programming Succinctly by Unknown

Author:Unknown
Language: eng
Format: azw3
Published: 2017-05-31T21:40:31+00:00


56

3.3 OOP using S4

In 2001, the R language introduced an OOP model called S4 that is quite a bit more

sophisticated than the earlier S3 model. However, for many programming scenarios, the

advanced features available in S4 (such as a form of inheritance and checking for input validity)

are optional and not needed.

Code Listing 9: S4 Model OOP

# persons.R

# R 3.2.4

# S4 OOP

Person = setClass(

“Person”,

slots = list(

lastName = “character”,

age = “integer”,

payRate = “numeric”

),



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.