Task 1
Create a vector containing the numbers 2, 5, 2.4 and 11.
- What is the type of this vector?
- Replace the second element with
5.9. - Add the elements
3and1to the beginning, and the elements"8.0"and"9.2"to the end of the vector. - Transform this vector into the type integer. What happens?
Task 2
- What type is the following vector:
"2","Hello",4.0, andTRUE - What hierarchy is underlying this?
Task 3
- Create a vector with the numbers from
-8to9(step size:0.5) - Compute the square root of each element of the first vector using vectorisation. Anything that draws your attention?
Task 4
Create a list that has three named elements: "A", "B", and "C"
- The element
"A"should contain the square root of the numbers form -2 to 8 (step size:1) - The element
"B"should contain the log of numbers between 2 and 4 (step size:0.5) - The element
"C"should contain letters froma1tog7(hint: use the pre-defined vectorlettersand the functionpaste())