rhcaeb / QFC-course

Programming Fundamentals Using R
0 stars 0 forks source link

Complete application 2-4 #15

Closed rhcaeb closed 4 years ago

rhcaeb commented 4 years ago

Application 2-4

Notes

Pending review @belinskyc

rhcaeb commented 4 years ago

Comments

Not too many issues with this application (assuming there are no errors!!!). I just had to make sure that everything lined up within a single for() loop.

rhcaeb commented 4 years ago

Yeah, that looks pretty good. Maybe I have finally got the lessons down!

How about a little challenge here. You have everything as an if statement, which means that every if() is checked even though you know that there are if statements that are mutually exclusive. For instance, if data[j] == 78 then data[j] cannot be equal to 87.

Rewrite this using if-else statements so that you not wasting extra electrons checking if statements that you know cannot be TRUE because something mutually exclusive has already been evaluated as TRUE.

I will work on this on a new branch, and merge it to the master under a new script file called app2-4AltAnswer.R (after a pull request for review).