Question: Question 4 : Loops and vectorization in R Need R code and explanation. Using a for loop, create a new variable in the Orange data

Question 4: Loops and vectorization in R
Need R code and explanation. Using a for loop, create a new variable in the Orange data called old_and_large that takes the value TRUE
of age >1000 and circumference >200, and FALSE otherwise. Do the same thing in vectorized form (no
for loop). Hint: use the ifelse function.
data("Orange")
 Question 4: Loops and vectorization in R Need R code and

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!