Write a new function called MyVectorInfo() that takes as input a vector and returns the key characteristics of vector, such as the min, the max,
Write a new function called MyVectorInfo() that takes as input a vector and returns the key characteristics of vector, such as the min, the max, and the mean of the vector. Make sure to give careful thought about the parameters you will need to pass to your function and what kind of data object your function will return.
myVector <- c(1,2,3,4,5,6,7,8,9,10)
# define a new function "MyVectorInfo"
# HINT: If you are not sure how to start, use ALL the functions listed below (there are other ways doing this): function(myVector) return() c() which.max mean which.min MyVectorInfo <- {}
# HINT 2: If you want to print the names of the output values, you can use "cat" function. If you want to use "cat" function instead, one line may look like this: cat("mean: ", mean(myVector), "")
Step by Step Solution
3.34 Rating (160 Votes )
There are 3 Steps involved in it
Step: 1
the output function with code in c is as follow include include include usin...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