Question
In R script, This question uses the vectors xVec and yVec created in the previous question and the functions sort, order, mean, sqrt, sum and
In R script, This question uses the vectors xVec and yVec created in the previous question and the functions sort, order, mean, sqrt, sum and abs.
set.seed(50) xVec <- sample(0:999, 250, replace=T) yVec <- sample(0:999, 250, replace=T)
(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) 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 %%.) (e) Sort the numbers in the vector xVec in the order of increasing values in yVec. (f) 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