As I understand your problem you do not need to split the list in order to get all single or unique list entries, but use a combination of unlist
and unique
instead.
Let's assume you have a list of hashtags (just letters in the example) with different lengths, l_hashtags .
Some hashtags are repetitions.
unlisting the list will give you vector with all hashtags, including all repetitions.
applying unique
to this unlisted l_hastag gives you the unique members of the original list.
l_hashtags <- list(c(LETTERS[1:2]), rep(NA,5), LETTERS[5:15], c('A', 'N', 'N', 'J', 'K'))
l_hashtags
#> [[1]]
#> [1] "A" "B"
#>
#> [[2]]
#> [1] NA NA NA NA NA
#>
#> [[3]]
#> [1] "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O"
#>
#> [[4]]
#> [1] "A" "N" "N" "J" "K"
table(unlist(l_hashtags))
#>
#> A B E F G H I J K L M N O
#> 2 1 1 1 1 1 1 2 2 1 1 3 1
l_hashtags_unlisted <- unlist(l_hashtags)
unique(l_hashtags_unlisted)
#> [1] "A" "B" NA "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O"
You can of course put all this into one single line:
unique(unlist(l_hashtags))
# [1] "A" "B" NA "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…