【发布时间】:2011-09-20 00:27:33
【问题描述】:
我想向自身附加或添加一个 data.frame... 与添加的方式大致相同:
n <- n + t
我有一个创建 data.frame 的函数。
我一直在使用:
g <- function(compareA,compareB) {
for (i in 1:1000) {
ttr <- t.test(compareA, compareA, var.equal = TRUE)
tt_pvalues[i] <- ttr$p.value
}
name_tag <- paste(nameA, nameB, sep = "_Vs_")
tt_titles <- data.frame(name_tag, tt_titles)
# character vector which I want to add to a list
ALL_pvalues <- data.frame(tt_pvalues, ALL_pvalues)
# adding a numeric vector of values to a larger data.frame
}
cbind 在这里会更好吗?
【问题讨论】:
-
如果没有额外的信息,这很难回答。你可以为 tag、tt_titles 和 ALL_pvalues 运行 str(tag) 吗?我怀疑你不想要 data.frame 而实际上想要 cbind()。
-
我在原始问题中添加了更多信息。