Professional Documents
Culture Documents
Exercises 1
Exercises 1
Exercises 1
Exercise 1
> x <- 12
> y <- 5
p
2. Calculate x2 + y 2 . Assign a variable r = x2 + y 2 . What is the value
of r?
3. Delete the variables x, y, r [the rm() function can take multiple argu-
ments].
> rm(x, y, r)
4. Set X = [12, 24, 36, ..., 120], Y = [5, 10, 15, ..., 50] [use seq()].
a <- .Last.value
1
Problems
1. Without using R, determine the result of the following computation
We can plot values in R (much more on this later). Use the letter l
(for line), not the number 1.