## Exercise 01 1+1 3 * 7 4 ^ 4 3 + 5 ^ 2 (3 + 5) ^ 2 pi pi * 5 ^ 2 ## Challenge #1. Write an expression that returns the area of a circle whose diameter is 20. ## HINT: area = pi times radius squared pi * (20 / 2) ^ 2 ## Challenge #2: Compute the square root of 1,000 sqrt(1000) ## Saving your work as variables x = 2 * 7 x y = 3 + 4 x + y x + y ^ 4 ## Recover from an incomplete command z = 5 + 6 ## Reassigning variables z = 5 z z = 55 z z = z ^ 3 z ## Comparison (logical) operators x x > 5 x < 14 x <= 14 x > y x >= y * 2 x == 14 x == y * 2 ## Better names for objects & object classes show_size = 9 class(shoe_size) shoe_color = 'brown' class(shoe_color) ## What happens if you add apples and oranges? shoe_size + shoe_color ## Did I mention that R is case-sensitive? shoe_color == 'brown' shoe_color == 'Brown' ## Comparing Text "HELLO" == "hello" "HELLO" == toupper("hello") ## Plotting commands (teaser) hist(rnorm(1000))