Question: Create R code script to do the following using an ifelse() statement: Store the following vector of prices in the variable apple. : c(109,109.8,109.14,109.85,111.13,112.23) a)

Create R code script to do the following using an ifelse() statement:

Store the following vector of prices in the variable apple.

: c(109,109.8,109.14,109.85,111.13,112.23)

a) Create an ifelse() statement that tests each of the prices against the value 111.

b)If the price is less than 111, print the result "buy the apple stock".

c) Otherwise print "don't buy the apple stock".

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 Mathematics Questions!