Exercises

  1. Why does this code not work?
  2. my_variable <- 10
    my_varıable #> Error in eval(expr, envir, enclos): object 'my_varıable' not found

    Look carefully! (This may seem like an exercise in pointlessness, but training your brain to notice even the tiniest difference will pay off when programming)

  3. Tweak each of the following R commands so that they run correctly:

    library(tidyverse)
    
    ggplot(dota = mpg) + 
      geom_point(mapping = aes(x = displ, y = hwy))
    
    fliter(mpg, cyl = 8)
    filter(diamond, carat > 3)


  4. Press Alt Shift +  K. What happens? How can you get to the same place using the menus?


Source: H. Wickham and G. Grolemund, https://r4ds.had.co.nz/workflow-basics.html
Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 3.0 License.

Last modified: Thursday, 15 December 2022, 4:45 PM