Question: Question 1 ( More practice on the binary operators ) Prof. Lee is taking his friends and family to La Ronde, Montreal s iconic amusement

Question 1
(More practice on the binary operators) Prof. Lee is taking his friends and family to La Ronde, Montreals iconic amusement park. The heights of his group of 10 people, measured in centimeters, are recorded in the following vector:
heights = c(145.5,189.7,183,135.3,175,178,162,102,168.8,195.2)
Prof. Lees group is eager to ride the roller coaster, but theres a catch: only those whose height falls between 150 cm and 185 cm are allowed on the ride. With this heartbreaking news, answer the following questions:
To quickly determine who meets the height requirement, Prof. Lee decides to assign each person a unique English letter. In R, the LETTERS vector provides all the capital letters of the alphabet.
LETTERS
[1]"A""B""C""D""E""F""G""H" "I" "J""K""L""M""N""O""P""Q""R""S"
[20]"T""U""V""W""X""Y""Z"
Using LETTERS, find a simple way to assign "A" to "J"(in order) to each member of the group. So youll have to have the following:
heights
A B C D E F G H I J
145.5189.7183.0135.3175.0178.0162.0102.0168.8195.2
NOTE. Refrain from manually assigning characters to the group members one-by-one.
Next, we need to determine who is too tall, too short, or appropriately sized for the ride. Using appropriate binary operators, create a new vector named heights_eval. This vector should have the same indices as heights, with values assigned according to the following rules:
If the height is less than 150, assign short.
If the height is between 150 and 185(inclusive), assign pass.
If the height is greater than 185, assign tall.

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