Posts

Showing posts from February, 2023

R Object: S3 vs S4 (Assignment 7)

Image
Greetings Professor, In this assignment #7, I used the Object Oriented Systems S3 and S4 for completing this assignment. I created a new dataset by taking your example as an reference. And also answered the questions for the datasets S3 and S4. 1.S3 implements a generic function OO and it is different from many other programming languages like Java, C++, C, these implements message-passing  using OO. In the other programming languages, by calling methods to the objects and these objects determines which has to be called. This process is called "method call". But S3 is totally different by calling the methods via a special type of function called a 'generic function' and this decides which function has be to called. S4 and S3 works similarly by few differences. S4 have special functions to call or to define the generic functions and methods. And also it can pick methods based on number of arguments.  2. To determine the  base type(like integer or list) of an object ...

Doing math in R(Assignment 6)

Image
  Greetings Professor, In this assignment #6, I did math problems that are continued by the previous assignment #5 by using matrices and building a diagonal using 'diag()' functions for the assignment. This is a brief explanation of the code and the functions that I used in this assignment 6. 1. In the first step, I assigned the values A and B and gave the matrices to that values, and entered the number of columns(2). 2. Then by using the "diag()" function, I calculated and built the diagonal matrix of the given values. 3. For the given matrix of ncol = 5, by using the 'diag()' and 'A+diag()' functions, I calculated and built the diagonal to get the desired results professor. Please check the code attached below professor. In my GitHub repository, I posted my code and results in pictures and in file Professor. And this is my GitHub repository link:  https://github.com/Jahnavi193/Assignment6#assignment6 Thank you.

Doing Math in R(Assignment 5)

Image
 Greetings Professor, In this assignment #5, I did math problems by using matrices and vectors using different functions for the assignment. This is a brief explanation of the code and the functions that I used in this assignment 5. 1. The first step is to give values for the variables for the matrix and to convert the values from rows to columns and columns to rows I used the 'transpose' function to the code[t(A), t(B)]. 2. To create the two vectors I used the 'c()' function for the code. 3. To multiply the matrices I used the vectors as a function and assigned the values in code. 4. To multiply the matrix by matrix I used the % by A*a and B*b to the code and re-assigned the values of a and b by using the matrices to the code. 5. To inverse a value I assigned new values by the variable 'S' of 2X5 with 2 rows and used solve(S) and to check or to calculate the determinants values I used det(S) to the code to get the desired results professor. Please check the cod...

Programming structure in R(4 assignment)

Image
 Greetings professor, I uploaded a word document to my GitHub repository briefing about the work, code, and results professor. And also uploading the boxplot and histogram here below professor. This is my GitHub repository link : https://github.com/Jahnavi193/Assignment-4#assignment-4 Thank you.