1
鑑於以下數據:式給出:R一欄,發現該列的副本中data.frame
questionTagMatrix <- data.frame(question1=c("0","1","0"), question2=c("1","0", "0"), question3=c("0","1","0"), question4=c("0","1","1") )
rownames(questionTagMatrix)[1] <- "php"
rownames(questionTagMatrix)[2] <- "html"
rownames(questionTagMatrix)[3] <- "javascript"
newQuestion <- data.frame(newquestion=c("0","1","0"))
rownames(newQuestion)[1] <- "php"
rownames(newQuestion)[2] <- "html"
rownames(newQuestion)[3] <- "javascript"
如何找到等於newQuestion
的questionTagMatrix
所有列?
我得到一個錯誤:「錯誤Ops.data.frame( questionTagMatrix,newQuestion)等「 – tucson
@tucson查看我的編輯。不需要將newQuestion放入data.frame中,將其保存爲vector。 – agstudy