I generated the powerset of a vector of characters and now I want to select an item from the list of vectors I generated.
[[1]] char[0]
[[2]] char[1] "A"
[[3]] char[1] "B"
[[4]] char[2] "A" "B"
I want to select only "B" from the 4th line of the list, can you help me please ?
CodePudding user response:
I tried to reproduce a list that looks like yours and selected 'B' from vector [[4]]
x <- list(c(),c('A'),c('B'),c('A','B'))
x[[4]][2]
[1] "B"