Sunday, September 3, 2023

Module #2: Calculating Vector Mean

Calculating Vector Mean


The R script creates the myMean function, which computes the average of the assignment2 vector. The sum(assignment2) code calculates the total of each component in the vector assignment2. Using the formula, length(assignment2), the vector's length, or the number of assignment2's elements, is determined. The mean is then calculated by dividing the sum of the elements by the length of the vector.



The assignment2 vector's mean value is around 18.66667.

No comments:

Post a Comment

“Ethical Concerns on the Deployment of Self-driving Cars”: A Policy and Ethical Case Study Analysis

Alec Gremer University of South Florida LIS4414.001U23.50440 Information Policy and Ethics Dr. John N. Gathegi, June 12th, 2023 “The Ethical...