Question: Consider the following vector in the R console: x1 0, and y2[j] = 0, if x1[j] 0. (iii) Create a vector y4 whose i th
Consider the following vector in the R console: x1 <- c(1.1, -2.3, 2.5, 0.5, -3.2, -4, 5.2, -2.2, -2.2, 3) (i) Generate a new vector y1 whose entries are the entries of x1 with odd index; i.e., x[1], x[3], .... (ii) Form a vector y2 such that for each j, y2[j]=x1[j], if x1[j] > 0, and y2[j] = 0, if x1[j] 0. (iii) Create a vector y4 whose i th entry is 0 if x1[i]> 0 and 1 if x1[i] 0.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
