Posts

Showing posts from March, 2026

Assignment 10: Building my own R package

Image
 Assignment 10: Building my own R package I've spent a lot of time this week trying to accomplish the skeleton of the r package, but I am unable to get the git commands to work. Not sure why, seems like I've downloaded gigabytes of packages and other miscellaneous programs and yet in the terminal when I attempt to use git commands to commit it to the GitHub branch I fail.  My description can be seen above, this is a temporary loss, I have work at 9 am and it is now nearing 11pm, unfortunately I didn't allocate enough time today to completing this assignment, and I didn't realize how ill-prepared I was for the task itself. Seeing as this is something I need for my final project, not completing it in its entirety simply won't do, so for now I must submit just what I have available, and Tuesday when I don't have any commitments, I will resubmit this in its complete form. I apologize for my shortcomings here. As for my plan. I am a stock trader, actually a derivativ...

Assignment 9: Visualization in Base R, Lattice and ggplot2

Image
 Assignment 9: Visualization in Base R, Lattice and ggplot2      This assignment we were tasked with selecting a dataset within the provided list, which I chose the air quality dataset which I've been given the chance to use in the past in other assignments, and I felt it a good fit for this also  I began by exploring the dataset and I realized that if I wanted to do a timeseries plot for the lattice graph I had to reformat the data to add in the year, which I found exploring the data with "?airquality". The entirety of the code is available on my GitHub here, and t he code of all 3 graphs is shown here: The first graph using base R was simple and shown here:     This graph is showing the ozone level during the summer of 1973. An issue I found when creating this first graph was that the dataset had a large number of large gaps, and I dealt with this issue by just removing the NA values of the dataset and storing this all in a new variable airClean. I ...

Week 8: Input/Output, string manipulation and plyr package

Image
Week 8: Input/output, string manipulation and plyr package     This week was interesting, and the concepts covered within were quite complex this week, seeing code I've never seen before to alter csv files in ways I haven't had the chance to. I had issues downloading the file however, as it didn't wish to save properly, having instead to copy the info into a notepad file, save as all files, and manually type .csv at the end of the file.   However, in the end I got it done, the variable names may be a little wonky as a result, but the code is functional, and I will explain line by line what is going on. The code is available on my GitHub here , and I will upload the csv also. This is the first few lines of my program, with the first two simply reading in necessary libraries for the program to function, the third reading the csv data (file that I created) into the variable assignment8dataset and then we group the dataset by "sex" (gender), calculate the average grad...

Module 7: Object S3 vs S4

Image
 Module 7: Object S3 vs S4     This week we learnt about S3 and S4 systems, and I got to play around with a lot of code this week attempting to learn about it and satisfy the homework requirements, which I believe I have done to quite a sufficient level.  First, I created my own dataset, then, explored it using a variety of the generic functions to show it worked as intended. Then, I began with my first S3 addition to my created data frame, followed by my first S4 addition. I then added one more example of each to satisfy the fifth questions need for 2 examples of each and all of it will be available on my github linked here! Now I will answer the questions as they were asked: 1. How do you tell what OO system (S3 vs. S4) an object is associated with?    The easiest way to tackle this question is to explain what both are. An S3 object is informal, a list, data frame, vector with a class attribute attached. S4 objects however are formal, have slots and ...