Posts

Showing posts from February, 2021

Module #7

  Definitely been a while since I've seen the object oriented side of any programming language . My first language with C++ and I took that class in 2015. In this module I'll be making my own data and grabbing some data from a previous class.  The first thing I did was load the data from an Excel spreadsheet. It was data on my playlists in Spotify. First I check out the data using the head function and then use the list function they both look the same and then I use the STR function which yielded different results such as giving me more information on the data Types of each column. By using the is S4 function we can determine that the data loaded is not S4.  Then I create S3 data. I do this by using a simple list function. I use the class and attributes too. Then I create s4 data using the new function but before I use that I must create a class otherwise it will not work… and I did try.  How do you tell what OO system (S3 vs. S4) an object is associated with? Thi...

Module #6

 In this module, we did more math with matrices!  We were asked to examine two matrices, add them, minus them, and then use the diag() function. We were also asked to replicate/recreate a matrix with certain criteria.  #Start with two matrices A = matrix(c(2, 0, 1, 3), ncol = 2) B = matrix(c(5, 2,4, -1), ncol = 2) #Call/View matrices A      [,1] [,2] [1,]    2    1 [2,]    0    3 B      [,1] [,2] [1,]    5    4 [2,]    2   -1 #It appears that both matrices are the same size, therefore can be combined, added, subtracted.. etc..  # Find A + B C <- A + B #Call / View matrix C      [,1] [,2] [1,]    7    5 [2,]    2    2 # Find A - B D <- A - B #Call / View matrix D      [,1] [,2] [1,]   -3   -3 [2,]   -2    4 #Use the diag() function to build a mat...

Module #5

 This week our assignment was to inverse two matrices.  #Matrices A <- matrix(1:100, nrow = 10) B <- matrix(1:100, nrow = 10) #Transpose A_T <- t(A) B_T <- t(B) #Create two vectors A_vec <- c(1:10) B_vec <- c(1:100) #multiply matrices by vectors A_x <- A %*% A_vec B_x <- B %*% B_vec #re-assign the vectors a and b to equal the number of rows of the column for the #corresponding matrix A_vec <- nrow(A) B_vec <- nrow(B) #Multiply the matrix by a matrix C <- A %*% B #Inverse the matrix S <- matrix(2:5, nrow = 2) solve(S) Please see my Github! https://github.com/Midiquin/LIS4370.720S21/blob/main/Mod3.R

Module #4

Image
 This week we were asked to create a boxplot and histogram of faux local hospital data. As well as discuss the outcome of our results regarding patients' BPs & MD’s Ratings. From the first graph (boxplot), we can observe that patients with a higher final decision had visited the hospital more frequently than the lower final decision. We can also observe that those with higher blood pressure visited the hospital more frequently than those with lower blood pressure.  The second graph (histogram), displays that there were more "bad" first assessments with the patients with one N/A.   The second graph (histogram2), displays that there were more "high" blood pressure assesments by doctor #2.   library(ggplot2) #Data  p1<- c(0.6,103,'bad','low','low') p2<- c(0.3,87,'bad','low','high') p3<- c(0.4,32,'bad','high','low') p4<- c(0.4,42,'bad','high','high') p5...