How do you tell what OO system (S3 vs. S4) an object is associated with? In S3, objects are defined by the information already known by the characteristics of the object; a character or numeric are recognized in R for their attributes. S4 relies on the designation determined by a user or creator of the data. setClass() produces circumstances where the classes are harder to change and are set apart at the beginning. In addition, many features pertaining to syntax and etiquette separate these systems. For example, rather than using the argument data.frame$variable to identify a column within a data set, S4 used @ and "slot" to call variables and specific instances of data.
How do you determine the base type (like integer or list) of an object? Both systems are capable of taking advantage of the class() function to determine the class type of an object. Mode is also a tool that can be used to recognize the base type of objects within R.
What is a generic function? A generic function is a simple sequence of code that fulfills a command or task. The methods and route can be different however the purpose and ultimate result is a single goal.
What are the main differences between S3 and S4? S3 and S4 have two main differences as listed in the lecture: Firstly, S3 objects have classes and methods identified from the beginning, which are considered more informal and widely used. S4 objects have their classes and methods developed later and take a more formal and spatial methodology. Secondly, the language and protocols for articulating commands are different. Language and syntax provide the most visually distinct differences between the two object programming.
In your GitHub, create two examples of S3 and S4. Week 7 GitHub
Sunday, February 25, 2024
Week 7 S3 VS S4 Objects
Thursday, February 15, 2024
Module #6 Doing Math Part II
Module 6 built on the previous module. This weeks lecture and reading were related to additional function of linear of algebra and the different expressions of them through the use of matrices. The assignment for this week thus focused on the generation and calculation of numbers through the application of matrices. My code for this week looked like this:
Saturday, February 10, 2024
Module #5 Doing Math
This assignment was primarily concerned with the use of matrices within R.
The first part of this task was to create matrices that printed 100 and 1000 numbers across 10 rows, respectively. The matrix A contained 1:100 and matrix B contained 1:1000. The first step was to create two vectors. I decided to use the runif() function to create my vectors.
Thursday, February 1, 2024
Module 4 Programming structure in R
Module #10 Building your own R package
This assignment was tricky because I have never before considered being able to create my own R-package before and considered it to be more...
-
Module 6 built on the previous module. This weeks lecture and reading were related to additional function of linear of algebra and the diff...
-
Hi Dr. Friedman! Here is my GitHub repository location. https://github.com/JamesMohl/JamesDetails.git
-
This assignment was primarily concerned with the use of matrices within R. The first part of this task was to create matrices that printed...