Posts

Module 11

Image
 Debugging is an important part of being a programmer, unfortunately, it is the most infuriating part as well. In this module, we were asked to debug this code. So the first thing I did was just run the function by itself and I got this error: The second thing I did was try to find what kind of data could be inserted into it. I decided to make a list but it did not work I created a matrix. After doing so I tried to insert the matrix into the function which did not work so to figure out what the function was doing I spaced it out a bit and without deleting anything miraculously it worked. This confuses me.  Before:  After:  As you can see I just spaced-out line 9. Then I decided to run the matrix again and got this error: There is not a turkey.outlier I think the problem is that we need to remove that.  Removing it appears that the code works but just because it appears so doesn't mean it's actually working and I'm not quite sure how this function is working but ...

Module 10

Image
 This week's assignment was to create a description file for the R package we are going to create.  The package name is midio and the title is Daylio Visualizer.  This package is to be used with ggplot to create visualizations of data imported from the app named Daylio. Daylio is highly customizable productivity and mood tracking app.   We will start with version 0.1. Of course, the author and maintainer are yours truly.  The package will require a version of R greater than 3.1.2 and will need ggplot2.  Went with the CC0 license.  Encoding is UTF-8 and LazyData is true.  Please see my blog for more details: https://github.com/Midiquin/LIS4370.720S21/blob/main/desc_package

Module 9

Image
 In this module, we were tasked with picking random data and creating three visualizations from it. The data I chose was on the body weight and brain weight of five different primates.  I choose to use ggplot for all three visualizations. From my first visualization, I decided to create a bubble plot. The color indicates the type of primate and then the bubble size indicates the brain weight in grams.  The second visualization that I created is also known as a lollypop graph this one just shows the primates and body weight in kilograms.  The third visualization is a barplot under getting bodyweight primate type and brain weight in kilograms.  Please see my Github! https://github.com/Midiquin/LIS4370.720S21/blob/main/Mod9.R

Module #8

 In this module we discussed the input and output of our by looking at a few commands such as the scan, readline, and reading and writing file functions. So covered string manipulation functions as well as the PLYR package.  The scan function can easily scan a file into order. When scanning numbers the splitting on spaces or tabs is automatic.  Readline function is mostly used for prompting the user for input.  Print is something I've used a lot and R. It prints out a data set or other calculations onto the terminal.  The concatenation function also known as cat is best used when dealing with character strings. It is used to combine different strings together. this is useful for example if you have two columns with character values that you would like to combine into one column.  The read table Is more useful than scan because skin doesn't do so well with mixtures of numeric and character data as opposed to the read table function it will also fire in your ...

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