![](/img/trans.png)
[英]R dataframe : find list of elements in column 1 of corresponding to items in column 2
[英]R: Elements of a list into corresponding dataframe rows
我有一個包含 5667 個元素的大列表。 這些是最后的 3 個結果:
[[997]]
[1] 66 84 82 65 78 83 80 79 82 84 69 83 32 89 32 77 79 86 73 77 73 69 78 84 79 83 32 77 69 78 68 79 90 65 44 32 83 46 76 46
[[998]]
[1] 66 85 71 65 83 32 65 85 84 79 77 79 67 73 79 78
[[999]]
[1] 66 85 71 65 83 32 89 32 86 73 68 65 76
[[1000]]
[1] 66 85 71 65 83 32 89 32 86 73 68 65 76 32 45 32 108 97 32 99 111 114 117 241 97 32 45 32 65 32 67 79 82 85 209 65
[ reached getOption("max.print") -- omitted 4667 entries ]
另外我有一個 df 有 5667 行。 我想將列表中的每個元素放入 df 中新變量的相應行中。
喜歡:
df$new_variable[997] = 66 84 82 65 78 83 80 79 82 84 69 83 32 89 32 77 79 86 73 77 73 69 78 84 79 83 32 77 69 78 68 79 90 65 44 32 83 46 76 46
我們可以通過簡單地將list
分配給一個列名來創建一個list
列
df$new_variable <- lst1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.