Question
Use R script This question uses the vectors xVec = sample(0:999,250,replace=T) yVec = sample(0:999,250,replace=T)c reated in the previous question and the functions sort, order, mean,
Use R script
This question uses the vectors
xVec = sample(0:999,250,replace=T) yVec = sample(0:999,250,replace=T)c
reated in the previous question and the functions sort, order, mean, sqrt, sum and abs.
(a) Pick out the values in yVec which are > 600.
(b) What are the index positions in yVec of the values which are > 600?
(c) What are the values in xVec which correspond to the values in yVec which are > 600? (By correspond, we mean at the same index positions.) \
(d) Create the vector (|x1 | 1/2 , |x2 x| 1/2 , . . . , |xn x| 1/2 ) where x denotes the mean of the vector x = (x1, x2, . . . , xn).
(e) How many values in yVec are within 200 of the maximum value of the terms in yVec? (f) How many numbers in xVec are divisible by 2? (Note that the modulo operator is denoted %%.) (
g) Sort the numbers in the vector xVec in the order of increasing values in yVec.
(h) Pick out the elements in yVec at index positions 1, 4, 7, 10, 13, . . . .
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