Posts

Final Project

 Github repository: https://github.com/aishwaryashiv10/checkpoints Often times I face the difficulty of not being able to save all my results from my R console to a file to refer back to it later. For this reason I created a package called 'checkpoints' to be able to save all the R script input as well as the console output. This package will be able to export the input and output into a document and will be updated each time you run or rerun a code. This document will also save a timestamp letting you know the exact time it was updated. I first started off by defining an object called my_function to log the console outputs into the log file. Then I created a logger function that takes two arguments: Msg(the message to log) and a file_name (the name of the log file). Inside the function, we use the cat function to append the message to the log file, along with the current date and time. I then created an on.Load function that sets the default log file name. I also created a si...

Assignment 12

 I felt that Markdown was pretty simple on R studio as it lays out the format for you when you select the "R markdown" option. I used the existing R data set cars to get the data as well as create a plot from the data. The plot was a scatter plot that compared the distance vs the speed. However, I need to explore more of the different Markdown features in order to be more comfortable with it. 

Assignment 11

## Original Code tukey_multiple <- function(x) {   outliers <- array(TRUE,dim=dim(x))   for (j in 1:ncol(x))   {     outliers[,j] <- outliers[,j] && tukey.outlier(x[,j])   }   outlier.vec <- vector(length=nrow(x))   for (i in 1:nrow(x))   { outlier.vec[i] <- all(outliers[i,]) } return(outlier.vec) } #DeBugged Code tukey_multiple <- function(x) {   outliers <- array(TRUE, dim=dim(x))   for (j in 1:ncol(x)) {     outliers[,j] <- outliers[,j] && #tukey.outlier(x[,j])  ## tukey.outlier does not exist       }   outlier.vec <- vector(length=nrow(x))   for (i in 1:nrow(x)) {     outlier.vec[i] <- all(outliers[i,])   }   return(outlier.vec)  } To start debugging, I pasted the code into RStudio to see what kind of error it would throw. The syntax was wrong with the alignment of certain brackets and parentheses. I then realized that ...

Assignment 10

  Often times I face the difficulty of not being able to save all my  results from my R console to a file to refer back to it later. However, with my  new package "checkpoint",  it will be able to save the code and all the results from the consol  into a file and will be able to update the results for each line of code  incase you want to edit it and rerun it. This will help me really keep track of my results in one location without it being disorganized. https://github.com/aishwaryashiv10/Lis6371/blob/08a989e95e6e79ff1c97950fef1e3f7fb45b6de3/Module%2010%20Assignment.R

Assignment 9

Image
  I created a scatter plot of the brca dataset comparing the variables of the radius mean and the texture mean. I created a line graph of the brca dataset comparing the variables of the radius mean and the texture mean. I created a bar graph of the brca dataset comparing the variables of the radius mean and the texture mean and the perimeter mean.

Assignment 8

Image
 # Import dataset Module8 <- read.table('Users/aishwaryashivakumar/Downloads/Assignment\ 6\ Dataset-1.txt', header = TRUE, sep = ",")\ #run plyr generates for the mean of both Age and Grade split by gender install.packages("plyr") library(plyr)  StudentAverage <- ddply(Module8,"Sex",transform, Grade.Average=mean(Grade))  # Print to a file  write.table(Module8,"/Users/aishwaryashivakumar/Desktop/Student_Average", sep = ",") # Filter the names in the given list for names that contain the letter i newModule8 <- subset(Module8,grepl("[iI]",Module8$Name)) # Export filtered list as table write.table(newModule8,"/Users/aishwaryashivakumar/Desktop/Datasubset", sep = ",")

Assignment 6

 # Part 1  > A <- matrix(c(2,0,1,3), ncol=2) > B <- matrix(c(5,2,4,-1), ncol=2) > A + B      [,1] [,2] [1,]    7    5 [2,]    2    2 > A - B      [,1] [,2] [1,]   -3   -3 [2,]   -2    4 # Part 2 > diag(c(4,1,2,3))      [,1] [,2] [,3] [,4] [1,]    4    0    0    0 [2,]    0    1    0    0 [3,]    0    0    2    0 [4,]    0    0    0    3 # Part 3 > matrix(c(3,2,2,2,2,1,3,0,0,0,1,0,3,0,0,1,0,0,3,0,1,0,0,0,3), nrow = 5, byrow = FALSE)      [,1] [,2] [,3] [,4] [,5] [1,]    3    1    1    1    1 [2,]    2    3    0    0    0 [3,]    2    0  ...