Posts

Showing posts from January, 2024

Module #3

 1/28/2024 For this module I created a data frame based on the 2016 election results: election <- data.frame(   Name = c("Jeb", "Donald", "Ted", "Marco", "Carly", "Hillary", "Bernie"),   ABC_Poll_Results = c(4, 62, 51, 21, 2, 14, 15),   CBS_Poll_Results = c(12, 75, 43, 19, 1, 21, 19) ) These were my results: > print(election) Name ABC_Poll_Results CBS_Poll_Results 1 Jeb 4 12 2 Donald 62 75 3 Ted 51 43 4 Marco 21 19 5 Carly 2 1 6 Hillary 14 21 7 Bernie 15 19 Donald is the clear winner in both polls, scoring 62 and 75 respectively. Second comes Ted with 51 and 43. 

Module #2

3. Your assignment, evaluate the following function call  myMean . The data for this function called  assignment .  The myMean function successfully calculates the mean of the assignment2 vector. Sum divided by the length of the vector returns the mean.  assignment2 <- c(16, 18, 14, 22, 27, 17, 19, 17, 17, 22, 20, 22) myMean <- function(assignment2) {   return(sum(assignment2) / length(assignment2)) } myMean(assignment2) > myMean(assignment2) [1] 19.25

Module #1

 My GitHub repository:  elisah99/LIS4370 (github.com)