Module 7
Exploring Object-Oriented Systems in R In this assignment, I will download a dataset and explore whether generic functions, S3, and S4 object-oriented systems can be assigned to it. #### Step 1: Downloading Dataset I will use the `iris` dataset available in R. ```R # Load the iris dataset data("iris") head(iris) ``` #### Step 2: Generic Functions Assignment To determine if generic functions can be assigned to the `iris` dataset, I will attempt to assign a generic function. ```R # Define a generic function my_summary <- function(data) { summary(data) } # Attempt to assign the generic function to the iris dataset my_summary(iris) ``` Generic functions can be assigned to the `iris` dataset since it is a standard R data frame, and generic functions can operate on any R object. #### Step 3: S3 and S4 Assignment Next, I will explore if S3 and S4 object-oriented systems can be assigned to the `iris` dataset. ```R # Attempt to assign S3 class to the iris dataset class(iris) <...