我想使用的「被」呼這是很容易轉換成一個列表輸出...但名單仍然不予理睬我有時通過電話從環或lapply名單,R中
a = list('1'=c(19,3,4,5), '4'=c(3,5,3,2,1,6), '8'=c(1,3))
for (i in c(1,8,4)){
# would like to do something like this
a[["i"]] # calling list elements by name rather than #
}
#ideally the output would be something like this
>19,3,4,5
>1,3
>3,5,3,2,1,6
感謝您的快速響應!完美 – mmann1123
@ user1034797 - 如果Joshua的回答正是您所需要的,請不要忘記通過點擊左側的複選標記來「接受」它。謝謝。 –
另一種可能性可能是'for(我在名字(a)){...' – Marek