Quiz 14: Policies and Information

Location, Date, and Time

Conflicts: There will be no conflict quiz as students are able to choose the time and date of their quiz.

Quiz Content

All quizzes are cumulative. Previous material can reappear on a later quiz.

13.1: S3 Programming

Object Oriented Programming (OOP):

  • What is Object Oriented Programming (OOP)?
  • How could we make and use an automobile class?
  • What are the three core tenets of an OOP system?

S3 Objects:

  • Which OOP system is the most popular in R? Why?
  • How is Inheritance of a class structure used?
    • e.g. is it the first class from right-to-left, left-to-right, or is a class randomly selected?
  • Why is S3 said to be an informal OOP system? How is its informality problematic?
  • What does a generic function do?
  • How do we construct a generic function?
  • Why is polymorphism important in the context of a generic function?

Unpaired (Two Sample) t-Test:

  • How can we modify an existing function to use an S3 object dispatch?
  • What benefits do we obtain when creating our own print() and summary() methods for classes?

13.2 R Packages

Provided with: Package Development devtools Cheatsheet

Motivation:

  • Why should we build an R package?
  • How are R Script/R Markdown files different from routines found inside an R package?
  • Where are R packages frequently used?

Structure of R Packages:

  • How is a minimal R package structured?
  • What is the difference between the NAMESPACE and DESCRIPTION files?
  • How are licenses used when distributing code?
  • Why is it important to license code?
  • Why do we prefer to use roxygen2 to create documentation than writing our own .Rd files?
  • What happens when R CMD check is run on a package?

Unit Testing:

  • What is a unit test?
  • Why should unit tests be written instead of exploring code in the console?
  • How does continous integration differ from looking at test coverage of code?

13.3 Algorithm Complexity

Empirical Runtime:

  • What is a benchmark?
  • Why are benchmarks useful when looking at algorithm implementations?
  • How does an rbenchmark() differ from a microbenchmark()?

Theoretical Run Time:

  • What does Big Oh notation denote?
  • What would be the best Big Oh for code to have? What would be the worst?
  • How is \(T(n)\) different than Big Oh? How are they the same?
  • Why do we want to classify code in the form of Big Oh?

Theoretical Big Oh for Code:

  • Why is some code considered negligible in terms of cost?
  • What kind of code would have \(O(n)\)?
  • How is the Big Oh for a function defined? What about an if-else statement?

Materials Needed

  • Preferably, a rested mind and non-broken hands that can type.

Policies

  • All answers must be reasonably simplified.
  • Decimals answers must contain two significant digits.
  • Grading will be done as follows:
    • A correct answer will receive all points.
    • An incorrect answer will receive proportionally appropriate partial credit.

If you have a technical issue while answering questions or need assistance with opening or starting the quiz, please alert the proctor.

Do not leave the CBTF without filing an issue with the proctor if something goes wrong.

DRES

Have a testing accommodation? Please see how the CBTF handles Letters of Accommodation.

The short version: Please bring a copy of the Letter of Accommodation to the CBTF Proctors prior to the test taking place.

Academic Integrity

In short, don’t cheat. Keep your eyes on your own quiz. Do not discuss the quiz with your friends after you have taken it. Any violation will be punished as harshly as possible.

Advice for Studying

The best way to study for a STAT 385 quiz is by writing and reading code. Try to take an idea in STAT 385 and apply it to your own work.

With this being said, there are three other resources that may assist your studies:

  • Topic Outline (Above)
  • Lecture Code
  • Homework

Again, the best way to study is to do programming in some fashion. Whether that be writing code or explaining how code works to someone else.

Consider using resources such as:

  1. RStudio Cloud Primers for interactive practice.
  2. Exercise problems listed in a given section of the readings.

Do not spend time memorizing lecture slides. You will not see any verbatim questions.

Do not try pulling an all-nighter. You can schedule your quiz anytime between a time window. To program efficiently, you need sleep despite the quote:

“Programmers are an organism that turns caffeine into code.”

Frequently Asked Questions

What kind of question types are on the quiz?

There are generally four types of problems:

  • True / False
  • Multiple Selection (e.g. select ALL correct answers from a list)
  • Fill in the blank
  • Writing Code

How many problems are on the quiz?

Only one question with 15012391 subquestions. In all seriousness, do not fixate on a number. There will be a reasonable amount of questions for the time period.

How long will it take to do the quiz?

Depending on your background, the quiz may take:

  • Prior R in-depth experience: 25 minutes
  • Some R experience: 35 minutes
  • No R experience: 50 minutes

Avoid fixating on time. Life will come and go more quickly than you realize. Focus more on the content.

When will the quiz be returned?

As all problems are automatically graded, we should be able to post the quiz results after the examination window closes.

Will the quiz be curved?

No.

We got our grades back, now will the quiz be curved?

No. Curving is only done sparingly at the end of the semester. Individual assignments are not modified.