![]() |
In this article, we will discuss What is a list and various methods to create a list using R Programming Language. What is a list?A list is the one-dimensional heterogeneous data i.e., which stores the data of various types such as integers, float, strings, logical values, and characters. These lists provide flexibility and can be accessed by using indexing. Some of the methods to create the list are: Creating a list by using the ‘list()’ functionThis method is used to create the list by using the function ‘list()’ efficiently. In the below example, we created the list by using the function ‘list()’.
Output: [1] "The list is" In the below example, we created the list by using the function ‘list()’.
Output: [1] "The list is" Creating list by using ConcatenationThis method is used to create the list by using the function ‘c()’ efficiently. In the below example, we created the the vectors and by using it, we created the list by using the function ‘c()’.
Output: [1] "The list is" In the below example, we created the the vectors and by using it, we created the list by using the function ‘c()’.
Output: [1] "The list is" ConclusionIn conclusion, we learned about how to create a list by using R. R language offers versatile tools while creating the list efficiently. |
Reffered: https://www.geeksforgeeks.org
R Language |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 15 |