I am the Co-Founder of The Data Monk. I have a total of 6+ years of analytics experience
3+ years at Mu Sigma
2 years at OYO
1 year and counting at The Data Monk
I am an active trader and a logically sarcastic idiot :)
Follow Me
Unlist function flattens out the list.
Given a list structure x, unlist simplifies it to produce a vector which contains all the
atomic components which occur in x. This function will also unlist all lists within the list as well.
Answers ( 2 )
Unlist function flattens out the list.
Given a list structure x, unlist simplifies it to produce a vector which contains all the
atomic components which occur in x. This function will also unlist all lists within the list as well.
test1 unlist(test1)
[1] “3” “a” “15” “b”
> test2 test2
$v1
[1] 5
$v2
$v2[[1]]
[1] 2983
$v2[[2]]
[1] 1890
$v3
[1] 3 119
> unlist(test2)
v1 v21 v22 v31 v32
5 2983 1890 3 119
unlist function in R, simply converts the list to vector with all the atomic components are being preserved
Syntax for unlist function in R:
unlist(x, recursive = TRUE, use.names = TRUE)