Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You want to calculate mean of the two vectors (vec1 and vec2). Copy and paste the following codes. The last line will give you an

You want to calculate mean of the two vectors (vec1 and vec2). Copy and paste the following codes. The last line will give you an error message. Fix the error in the last line.

# Don't edit these two lines

vec1 <- c(1.5, 2.5, 8.4, 3.7, 6.3)

vec2 <- rev(vec1)

# Fix the error

mean(abs(vec1), abs(vec2))

*****HINT: In your RStudio, check the syntax of mean by using this: ?mean

You will find that mean only take one argument. How do you combine two values into one?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is Centrifugation?

Answered: 1 week ago

Question

To find integral of ?a 2 - x 2

Answered: 1 week ago

Question

To find integral of e 3x sin4x

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago

Question

What are Fatty acids?

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago