0
のデータフレームにrbind使用して、私はこれで問題のビットに実行しています:R - データフレーム
> dput(df1)
structure(list(`1` = structure(list(type = c("Player", "Player",
"Player"), value = c(2980668L, 2980676L, 2980670L)), .Names = c("type",
"value"), row.names = c(NA, 3L), class = "data.frame"), `2` = structure(list(
type = c("Player", NA, "Player"), value = c(NA, NA, 419405L
)), .Names = c("type", "value"), row.names = c(NA, 3L), class = "data.frame"),
`26` = structure(list(type = c(NA_character_, NA_character_,
NA_character_), value = structure(list(coordinates = structure(list(
x = c(0.90043921853644, NA, NA), y = c(0.40441176470588,
NA, NA)), .Names = c("x", "y"), row.names = c(NA, 3L), class = "data.frame"),
region = c(2L, NA, NA)), .Names = c("coordinates", "region"
), row.names = c(NA, 3L), class = "data.frame")), .Names = c("type",
"value"), row.names = c(NA, 3L), class = "data.frame"), `36` = structure(list(
type = c(NA, NA, NA), value = c("Unknown", NA, NA)), .Names = c("type",
"value"), row.names = c(NA, 3L), class = "data.frame")), .Names = c("1",
"2", "26", "36"), class = "data.frame", row.names = c("200001",
"200002", "200003"))
> dput(df2)
structure(list(`1` = structure(list(type = c("Player", "Player",
"Player"), value = c(2980668L, 2980676L, 2980670L)), .Names = c("type",
"value"), row.names = c(NA, 3L), class = "data.frame"), `2` = structure(list(
type = c("Player", NA, "Player"), value = c(NA, NA, 419405L
)), .Names = c("type", "value"), row.names = c(NA, 3L), class = "data.frame"),
`26` = structure(list(type = c(NA_character_, NA_character_,
NA_character_), value = structure(list(coordinates = structure(list(
x = c(0.90043921853644, NA, NA), y = c(0.40441176470588,
NA, NA)), .Names = c("x", "y"), row.names = c(NA, 3L), class = "data.frame"),
region = c(2L, NA, NA)), .Names = c("coordinates", "region"
), row.names = c(NA, 3L), class = "data.frame")), .Names = c("type",
"value"), row.names = c(NA, 3L), class = "data.frame"), `36` = structure(list(
type = c(NA, NA, NA), value = c("Unknown", NA, NA)), .Names = c("type",
"value"), row.names = c(NA, 3L), class = "data.frame")), .Names = c("1",
"2", "26", "36"), class = "data.frame", row.names = c("200004",
"200005", "200006")).
これらは私が一緒にrbind()
にしようとしている例のデータフレームです。この例の場合、rownames以外のものはすべて同じです。私は2つ上rbind()
を実行しようとすると、私は次のエラーを取得:私はこのrbind()
作品を作ることができる方法についての
> rbind(temp, temp2)
Error in `row.names<-.data.frame`(`*tmp*`, value = value) :
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ‘1’, ‘2’, ‘3’
任意の考えをいただければ幸いです、ありがとう!
からデータを抽出することです、temp2、make.row.names = FALSE) ' – Sathish
ありがとうございましたが、それらの提案のいずれかで運がありません – Canovice
この構造はかなり厄介です。私は内側のdata.framesを 'rbind'の前に単一のdata.frameに抽出することを提案します – lmo