1 Task 1

Create a vector containing the numbers 2, 5, 2.4 and 11.

  1. What is the type of this vector?
  2. Replace the second element with 5.9.
  3. Add the elements 3 and 1 to the beginning, and the elements "8.0" and "9.2" to the end of the vector.
  4. Transform this vector into the type integer. What happens?

2 Task 2

  1. What type is the following vector: "2", "Hello", 4.0, and TRUE
  2. What hierarchy is underlying this?

3 Task 3

  1. Create a vector with the numbers from -8 to 9 (step size: 0.5)
  2. Compute the square root of each element of the first vector using vectorisation. Anything that draws your attention?

4 Task 4

Create a list that has three named elements: "A", "B", and "C"

Link to the solutions