4.4 Exercises

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

In the 2nd line ı is used instead of i, calling a variable not yet created.

  1. Tweak each of the following R commands so that they run correctly:
library(tidyverse)

ggplot(data = mpg) + 
  geom_point(mapping = aes(x = displ, y = hwy))

filter(mpg, cyl == 8)
# filter(diamond, carat > 3)
  1. Press Alt + Shift + K. What happens? How can you get to the same place using the menus?

Tools > Keyboard Shortcuts Help