Question: Let x be a numeric vector. Create a new vector y which consists of all entries of x between - 3 and 3 ( including

Let x be a numeric vector. Create a new vector y which consists of all entries of x between -3 and 3(including -3 and 3), in order of appearance as in the vector x. For example, if
x=c(-5,7,0,3,14,9,5,10,-2,0,12)
then, printing y should read
y
Similarly to the previous problem, we create a function extract () within which you need to type y in terms of x, so that for various vectors x the output extract (x) always gives the entries of x that are between -3 and 3(including -3 and 3).
 Let x be a numeric vector. Create a new vector y

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!