30.6k views
4 votes
Create a vector test which contains the following sequence - "low","medium","low","low","medium","medium","high","high","high","low" Convert test to a vector of type factor. Make sure the levels have order. Assign the 10th element in the vector test to ‘very low’ Print the test vector and see if the 10th element has been assigned correctly. If not adjust the levels argument of the test vector to include very low.

User Dorinand
by
5.5k points

1 Answer

5 votes

Answer:

The code for this working is attached below in input image with all comments given for briefing the functionality and the results have been displayed in output image.

Create a vector test which contains the following sequence - "low",&quot-example-1
Create a vector test which contains the following sequence - "low",&quot-example-2
User Geomorillo
by
6.3k points