I asked a question yesterday asking for how to access all elements of a nested list by name. https://stackoverflow.com/a/64579426/9806500
Is there a generalized function that will let me get named elements that are deeper in the list? In particular, I'm trying to get the users and timestamps of replies to a Slack message, and the message schema names reuses user and ts under a replies level of the message in pairs to designate who and when replied. I cannot get to them with the purrr solution link above. Not sure if this is because user and ts are also element names for the main message, or because I'm not able to access levels that far down by using ~ purrr::map() as a mapper function inside map().
l <- list(folder_1 = list(
`msg_1-1` = list(type = "message",
subtype = "channel_join",
ts = "1585771048.000200",
user = "UFUNNF8MA",
text = "<@UFUNNF8MA> has joined the channel"),
`msg_1-2` = list(type = "message",
subtype = "channel_purpose",
ts = "1585771049.000300",
user = "UNFUNQ8MA",
text = "<@UNFUNQ8MA> set the channel purpose: Talk about xyz")),
folder_2 = list(
`msg_2-1` = list(type = "message",
subtype = "channel_join",
ts = "1585771120.000200",
user = "UQKUNF8MA",
text = "<@UQKUNF8MA> has joined the channel",
replies = list(list(user = "UABCDEFG8", ts = "1585771220.002200"),
list(user = "UGFEDCBA8", ts = "1585771220.022000")))))
Thanks!