2
給出列表的列表本身,是否有一種優雅的方式將原始文件轉換爲對待?我使用簡單的值,如1,2,3,但值可能是數據幀或任何。我們的目標不是去重複每個獨特命名的內容,只是通過合併內容來重複名稱。按重複名稱合併列表列表中的內容
original = structure(list(name1 = structure(list(one = 1, two = 2, three = 3), .Names = c("one",
"two", "three")), name2 = structure(list(a = 9), .Names = "a"),
name1 = structure(list(four = 4, five = 5, six = 6), .Names = c("four",
"five", "six")), name2 = structure(list(b = 8), .Names = "b")), .Names = c("name1",
"name2", "name1", "name2"))
treated = structure(list(name1 = structure(list(one = 1, two = 2, three = 3,
four = 4, five = 5, six = 6), .Names = c("one", "two", "three",
"four", "five", "six")), name2 = structure(list(a = 9, b = 8), .Names = c("a",
"b"))), .Names = c("name1", "name2"))
modifyList我想(在我的手機上) – hadley