具有以下向量列表:
ourTeams <- list("eric" = c("tigers"), "tate" = c("vols","titans"),"heather" = c("gators","tide"))
需要使用for循环来访问列表中的键和值,以便输出看起来像这样:
eric likes the tigers
tate likes the vols and titans
heather likes the gators and tide
我们的代码无法“硬编码”列表中的元素数量...因此,如果我将元素添加到其中一个
嵌套在向量中的列表仍然可以使用。我很确定他们希望我使用for循环。
答案 0 :(得分:0)
df=df.T