The dataset for this assignment was related to the construction of a data frame. Poll results from two news stations were included and reported on the results for seven candidates. To create this data frame using the provided data, I listed the names and poll numbers in a series of vectors
Thursday, January 25, 2024
Module 3: Data Frames
Next, I created the data frame using the "data.frame" function within R. In addition, I used the "cbind" function to incorporate the data from the CBS vector. 
I wanted to create column and row names in order to identify the candidate votes and which station these were reported from. "Colnames" and "rownames" allowed me to input new titles for the data frame.
This is the final outcome for the data frame after these steps were taken. It provides a more organized and concise appearance, allowing comparative insight to be made about these reports.
With this data frame, we can utilize other functions within R to determine a great number of qualities about the data.
Sunday, January 21, 2024
Module # 2 Introduction to basic R functions and Data Structures
When given the myMean expression, the intended effect is to calculate the mean of a vector or object. Instead, an error message appears as such:
The issue with this line of code is that it makes assumptions about certain meanings and behaviors within the function. An example of this issue is that R does not recognize the function as computing an input, because the sole use of it in its current state is to calculate an unknown about the vector "assignment2". While the vector does contain a series of numbers, the function cannot properly run because the instructions are incorrect within the function itself. The existing code reads as follows:myMean <- function(assignment2)/length(assignment2)
{
return(sum(assignment2)/length(assignment2))
}
Which essentially "double-dips" in the intention of the code and produces a run error. Instead, the code should drop the latter part of the function directive (/length(assignment2)) and run normally.
This code returns an answer of 19.25, which can be confirmed using the mean() function and determining that these answers are consistent.
Sunday, January 14, 2024
Module #1 Assignment
Hi Dr. Friedman!
Here is my GitHub repository location.
https://github.com/JamesMohl/JamesDetails.git
Subscribe to:
Posts (Atom)
Module #10 Building your own R package
This assignment was tricky because I have never before considered being able to create my own R-package before and considered it to be more...
-
Module 6 built on the previous module. This weeks lecture and reading were related to additional function of linear of algebra and the diff...
-
Hi Dr. Friedman! Here is my GitHub repository location. https://github.com/JamesMohl/JamesDetails.git
-
This assignment was primarily concerned with the use of matrices within R. The first part of this task was to create matrices that printed...