How to get the labels of items in an R list -


this question exact duplicate of:

i have object of type "large list" , want list of labels follow dollar signs below. how do that?

str(example_list) list of 360 $ b32ad9c4fcbdd1f812                : chr [1:2201] "sd" "ssd" "dgaal" "de6" ... $ 6ba9eb1aa59226b8                : chr [1:2320] "83r" "ity" "dkem" "4kl" ... $ e1680cf14ebc88bbd521                : chr [1:2687] "62v" "dae" "ddv" "dal" ... 

you use names function because each item in larger list list own name.

so 1 item:

names(example_list[1]) 

we

[1]     "b32ad9c4fcbdd1f812" 

then list of lists

names(example_list) 

we

[1] "b32ad9c4fcbdd1f812", "6ba9eb1aa59226b8", "e1680cf14ebc88bbd521"

from answer question: extract names of objects list


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -