Question: How do I set up the code for #5? I have 1-4 computed fine. Would it be > Sum(height) / length (length) ? Define the

How do I set up the code for #5? I have 1-4 computed fine. Would it be

> Sum(height) / length (length) ?

Define the following vectors, which represent the weight and height of people on a

particular team (in inches and pounds):

height <- c(59,60,61,58,67,72,70)

weight <- c(150,140,180,220,160,140,130)

Define a variable:

a <- 150

Step 1: Calculating means

1) Compute, using R, the average height (called mean in R

2) Compute, using R, the average weight (called mean in R)

3) Calculate the length of the vector height and weight

4) Calculate the sum of the heights

5) Compute the average of both height and weight, by dividing the sum (of the height

or the width, as appropriate), by the length of the vector. How does this compare to

the mean function?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!