Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started