Skip to content

R Programming Last-Minute Revision

Quickly revise the questions you picked. Add questions from the interview-questions lists with Save to → Last-Minute Revision.

30 quick revision notes for R Programming

  1. R has six atomic types: logical, integer, double, character, complex and raw; typeof() shows the internal type.
  2. Combining types in c() coerces in the order logical, integer, double, character.
  3. NA is a missing value, NULL is the absence of an object and NaN results from undefined maths like 0/0.
  4. R indexes from 1, and negative indices drop elements instead of counting from the end.
  5. For lists, [ ] returns a sub-list while [[ ]] and $ return the element itself.
  6. Vectorized operations run in compiled code and are much faster than element-wise R for loops.
  7. The recycling rule repeats shorter vectors and warns only when lengths are not multiples.
  8. Use as.numeric(as.character(f)) to convert a numeric factor, because as.numeric(f) returns level codes.
  9. Growing objects in a loop causes repeated copies; preallocate a list and bind once at the end.
  10. The native pipe |> is built into R since version 4.1, while %>% comes from magrittr.
  11. Tidy data means each variable is a column, each observation a row and each unit type a table.
  12. summarise() collapses groups to one row each, while mutate() keeps the original number of rows.
  13. Use ungroup() or .groups = 'drop' to avoid accidental grouped calculations later in a pipeline.
  14. anti_join() finds rows in one table without a match in another, ideal for reconciliation.
  15. Embrace function arguments with {{ }} to pass column names into dplyr verbs inside your own functions.
  16. In ggplot2, map variables inside aes() and set constant aesthetics outside aes().
  17. In ggplot2, geom_bar() counts rows for each category, while geom_col() plots precomputed y values as they are.
  18. coord_cartesian() zooms without dropping data, while scale limits remove data before statistics are computed.
  19. A p-value is the probability of data this extreme if the null is true, not the probability the null is true.
  20. A Type I error is a false positive with probability alpha; power equals one minus the Type II error rate.
  21. Use wilcox.test() for two groups or kruskal.test() for more when small samples are clearly non-normal.
  22. power.prop.test() estimates the sample size needed per group for an A/B test on conversion rates.
  23. p.adjust() with method 'BH' controls the false discovery rate when running many tests.
  24. glm() with family = binomial fits logistic regression; exp(coef()) gives odds ratios.
  25. In tidymodels, recipes learn preprocessing on training data only, which prevents data leakage.
  26. For imbalanced classes, evaluate with precision, recall and PR AUC rather than accuracy.
  27. glmnet uses alpha = 1 for lasso and alpha = 0 for ridge; cv.glmnet() chooses lambda.
  28. In Shiny, reactive() caches computed values while observeEvent() runs side effects on specific events.
  29. renv::snapshot() records exact package versions in renv.lock, and renv::restore() reinstalls the same versions on another machine.
  30. Store credentials in .Renviron or keyring and read them with Sys.getenv(), never hardcode them in scripts.

Night-before checklist

  • Revise your saved questions on this page once, aloud.
  • Read the quick notes and mark any you cannot explain in one line.
  • Rehearse a two-minute self-introduction and two project stories.
  • Keep CV, ID, laptop charger and interview link ready; sleep on time.

Frequently asked questions

How does Last-Minute Revision work?

On any question page, open Save to → Last-Minute Revision. Saved questions appear here with their answers, so the night before an interview you revise only what you found hard.

Is my list saved?

Yes, in this browser. Guests can save 5 questions; free accounts can save 20 for revision and 100 for the 7-day plan.

What should I revise last before a R Programming interview?

Your saved misses first, then the quick notes on this page, then one or two project stories. Avoid learning brand-new topics the night before.