Question: Selection by comparison - Step 1 By making use of comparison operators, we can approach the previous question in a more proactive way. The (

Selection by comparison - Step 1
By making use of comparison operators, we can approach the previous question in a more proactive way.
The (logical) comparison operators known to R are:
for less than
> for greater than
= for less than or equal to
== for equal to each other
not equal to each other
As seen in the previous chapter, stating 6>5 returns TRUE. The nice thing about R is that you can use these comparison operators also on vectors. For example:
c(4,5,6)>5
[1] FALSE FALSE TRUE
This command tests for every element of the vector if the condition stated by the comparison operator is TRUE or FALSE .
 Selection by comparison - Step 1 By making use of comparison

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!