当我尝试运行该函数时,它会收到错误:参数意味着行数不同:2,1,0。
我该怎么办?
install.packages("combinat")
require(combinat)
df2 <- c(1234,1333,1332,1333,15,1234,15, 162, 1234)
num2<- c(1,2,3,1,4,2,2, 2,3)
data.frame(df2,num2)
result1 <-combn(4, 2, function(reqn, df){
names(Filter(identity,
apply(table(df2, factor(num2, levels=reqn))>0, 1, all)))
}, df=df2, simplify=FALSE)
View(result1)