Posts

Showing posts from January, 2024

Module #3 Data.frame Assignment

Image
 This week's module goes over creating data frames to further analyze a dataset. For this assignment, we are provided with a fictional data set covering the 2016 presidential election and polling results.  > Name <- c("Jeb", “Donald”, "Ted”, “Marco” “Carly”, “Hillary”, “Berine”) > ABC political poll results <- c(4, 62 51, 21, 2, 14, 15) > CBS political poll results <- c(12, 75, 43, 19, 1, 21, 19)  Running this data in RStudio and creating a data frame from it gives us a visual to quickly see how the data is distributed. Name ABC_political_poll_results CBS_political_poll_results Jeb 4 12 Donald 62 75 Ted 51 43 Marco 21 19 Carly 2 1 Hillary 14 ...

Module #2 Intro to R Functions

Image
Github Repository:  matthewluu2002/R-Programming (github.com) The purpose of this function is to find the mean value of the dataset. The "myMean" functions essentially runs the standard formula of calculating mean (mean = sum/count) by taking the vector of numbers, adding them up with the sum function, and using the length function to count how many numbers are in the vector, finally dividing them by the count.  Running this function with the provided dataset returns the number 19.25, and when running the data set through a calculator normally, returns the same number as well. This proves the functionality of the myMean function.  File uploaded to my Github repository for availability to download and test. 

Module #1 Assignment

 Github Repository: https://github.com/matthewluu2002/R-Programming.git