Question: Q6 Using R create a new Boolean column in `raceResults` named `finished` that will contain `TRUE` if the driver finished the race and `FALSE` if

Q6 Using R create a new Boolean column in `raceResults` named `finished` that will contain `TRUE` if the driver finished the race and `FALSE` if they did not finish. Place the new column directly after the `status` column.

- The `status` variable indicates the finishing status of a driver in a race. Possible values are `Finished`; `+1 Lap`, `+2 Laps`, etc. for how far behind the leader they finished; or whether they had an `Accident` or `Collision`, `Engine` trouble, or other mechanical failure like a `Fuel leak`, etc. which prevented them from finishing the race. There are 137 different values. Use `table(raceResults$status)` to view a frequency table of all of the possible values.

- If the `status` is `Finished` or the `status` starts with a `+` (`+1 Lap`, `+2 Laps`, etc. meaning they finished 1 or two whole laps behind the leader) then the value in the new variable `finished` should be `TRUE`, otherwise the value should be `FALSE`.

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