The exercise 1: using vectors and objects.
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →Provide in the plain text R commands that finds/solves the following:
- Create an integer variable e holding the value 42! Check the object class of e with class()!
- Convert e to the character data type with as.character()! Check the object class again!
- Create a character vector friends with four names from your circle of friends or acquaintances!
- Index the second element from the vector friends!
- Replace the first element of the vector friends with “Isolde” and check the updated vector again!
- Create a vector v1 from the following elements 1, “Hello”, 2, “World” ! Check the object class!
- Create a vector v2 with numerical values (only integers) ranging from 4 to 10!
- Index the first three elements from v2!
- Index all elements of v2 except the second element and save the result as v2.subset!
- Use the length() function to find out the length of v2.subset (= the number of elements in the vector)!
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds