Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

R Programming List: Exercises, Practice, Solution

[An editor is available at the bottom of the page to write and execute the scripts.]

R Programming List [21 exercises with solution]

1. Write a R program to create a list containing strings, numbers, vectors and a logical values. Go to the editor
Click me to see the sample solution

2. Write a R program to list containing a vector, a matrix and a list and give names to the elements in the list. Go to the editor
Click me to see the sample solution

3. Write a R program to create a list containing a vector, a matrix and a list and give names to the elements in the list. Access the first and second element of the list. Go to the editor
Click me to see the sample solution

4. Write a R program to create a list containing a vector, a matrix and a list and add element at the end of the list. Go to the editor
Click me to see the sample solution

5. Write a R program to select second element of a given nested list. Go to the editor
Click me to see the sample solution

6. Write a R program to create a list containing a vector, a matrix and a list and remove the second element. Go to the editor
Click me to see the sample solution

7. Write a R program to create a list containing a vector, a matrix and a list and update the last element. Go to the editor
Click me to see the sample solution

8. Write a R program to merge two given lists into one list. Go to the editor
Click me to see the sample solution

9. Write a R program to convert a given list to vector. Go to the editor
Click me to see the sample solution

10. Write a R program to create a list of dataframes and access each of those dataframes from the list. Go to the editor
Click me to see the sample solution

11. Write a R program to count number of objects in a given list. Go to the editor
Click me to see the sample solution

12. Write a R program to convert a given dataframe to a list by rows. Go to the editor
Click me to see the sample solution

13. Write a R program to convert a given matrix to a list. Go to the editor
Click me to see the sample solution

14. Write a R program to assign NULL to a given list element. Go to the editor
Click me to see the sample solution

15. Write a R program to create a list named s containing sequence of 15 capital letters, starting from ‘E’. Go to the editor
Click me to see the sample solution

16. Write a R program to Add 10 to each element of the first vector in a given list Go to the editor
Click me to see the sample solution

17. Write a R program to extract all elements except the third element of the first vector of a given list. Go to the editor
Click me to see the sample solution

18. Write a R program to add a new item g4 = "Python" to a given list. Go to the editor
Click me to see the sample solution

19. Write a R program to assign new names "a", "b" and "c" to the elements of a given list. Go to the editor
Click me to see the sample solution

20. Write a R program to get the length of the first two vectors of a given list. Go to the editor
Click me to see the sample solution

21. Write a R program to find all elements of a given list that are not in another given list. Go to the editor
Click me to see the sample solution

R Programming Code Editor:


More to Come !

Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.