Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 . Give the R commands to do the following: ( a ) Use rep ( ) to create a vector that has the following
Give the R commands to do the following:
a Use rep to create a vector that has the following elements:
b Use seq with the length.out argument to create a vector that has the following
elements:
c Let x be a vector of length three or greater that contains numeric elements. Write
some R commands that calculate the sample mean of all of the elements of x
except the smallest and largest. For example, if x you should
output the mean of If x you should output the
mean of x Hint: Make use of which, min, max, mean.
d Let x be a vector containing numerical elements, each of which is a positive integer.
Write a single line of R code that replaces each element that is a perfect square
with zero. For example, if x then you should return
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