unlist() function in R Language is used to convert a list to vector. It simplifies to produce a vector by preserving all components.
list: It is a list or Vector
use.name: Boolean value to prserve or not the position names
Example 1: Converting list numeric vector into a single vector
l11 l12 l13 l14 l21 l22 l23 l31 l32 l33 l34 l35 l36 l37 1 3 5 7 1 2 3 1 1 10 5 8 65 90
Here in the above code we have unlisted my_list using
unlist() and convert it to a single vector.
As illustrated above, the list will dissolve and every element will be in the same line as shown above.
Example 2: Unlisting list with dataframe:
 1 3 5 7 1 2 3 1 1 10 5 8 65 90 1 2 3 4 5 6
Here in the above code we have modified the previous list and added new elements to “my_list_2” and used the function
unlist() on it.
Also we set the “use.name” parameter to “FALSE” so we will not see the position names of the values in the vector.
- Convert elements of a Vector to Strings in R Language - toString() Function
- Generate a Vector of specified length with each element as a unique color on RGB scale in R Language - topo.colors() Function
- Generate a Vector of specified length with each element as a unique color on RB scale in RGB spectrum in R Language - cm.colors() Function
- Generate a Vector of specified length with each element as a unique color on RG scale in RGB spectrum in R Language - terrain.colors() Function
- Find Location and Character Vector of an Object with partial name in R Language - apropos() and find() Function
- Check for the Existence of a Vector Object in R Programming - is.vector() Function
- Convert an Object into a Vector in R Programming - as.vector() Function
- Create a Vector of Colors from a Vector of Gray Levels in R Programming - gray() or grey() Function
- Combine Arguments into a Vector in R Programming - c() Function
- Divide a Vector into Ranges in R Programming - cut() Function
- Sorting of a Vector in R Programming - sort() Function
- Create a Vector of Colors with specified Hue, Saturation and Value in R Programming - hsv() Function
- Getting Match of an Element within a Vector in R Programming - charmatch() Function
- Binning a Numeric Vector in R Programming - .bincode() Function
- Check if values in a vector are True or not in R Programming - all() and any() Function
- Creating a Vector of sequenced elements in R Programming - seq() Function
- Check for a Pattern in the Vector in R Programming - grepl() Function
- Rounding off values in R Language - round() Function
- Calculate the Cumulative Maxima of a Vector in R Programming - cummax() Function
- Adding Noise to a Numeric Vector in R Programming - jitter() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.