USF Information Science Blog

Coding and Statistics work for the University of South Florida. Completed by Alina Hagen


Module # 2 Assignment

1. I have downloaded the outline instructions for how to import data into RStudio. I think this is a great reference for how to important multiple data types and formats into R and look forward to having it on hand for future assignments

2. I was actually very surprised when I first looked at our Introductory Statistics with R textbook, as I had just completed a certificate on Datacamp that referenced and discussed the precedents set by this publication. Much of what was discussed in Chapter 1 was familiar to me, as I took Introduction to Data Science in the Spring 2024, but it was a welcome refresher after a summer away from RStudio, especially the section on difference data and object types.

However, in regard to The Art of R programming, one thing I was surprised to learn was that R is considered object-oriented programing. Suddenly, my mental comparisons between R and Java make a lot more sense, and I realize why USF wanted me to take an object-oriented programing course before i jumped into my data science core.

Of the two textbooks, I enjoyed reviewing The Art of R programming the most.

3. Your assignment, evaluate the following function call myMean. The data for this function called assignment. The assignment contains the following data:  6, 18, 14, 22, 27, 17, 19, 22, 20, 22.

The first line of this code creates a vector called assignment2, which holds the values 6, 18, 14, 22, 27, 17, 19, 22, 20, 22. The second line of code creates a function called myMean, which takes the argument ‘assignment2’, and then returns the mean (The Sum divided by the Length) of the values. The final line of the code runs the function myMean, using the vector assignment2 as the argument. The mean of assignment2 is reported to be 18.7

myMean is a custom function created by the user to calculate the mean of a group of values. It efficiently computes the average by summing all values in the vector and dividing by the count of values.

Published by


Leave a comment