这是我的代码:
X = read.csv("cpm-gender.csv")
Y = read.csv("page-level-gender.csv")
Z = merge(Y,X,by = c("Gender"),all = TRUE)
Z = merge(X,Y,by = c("Gender","Average_Age"),all = TRUE)
fix.by(by.x,x)中的错误:“ by”必须指定唯一有效的列
Z = merge(X,Y,by = "Gender",all = TRUE)
merge.data.frame(X,Y,by =“ Gender”,all = TRUE)中的错误: 不允许使用负长度向量。
请有人给我一个解决方案,将两者结合起来对组合数据进行机器学习。
答案 0 :(得分:0)
我认为您可能正在尝试合并错误的列名。试试:
Z = merge(X,Y,by = c("Gender","Average.Age"),all = TRUE)
或
Z = merge(X,Y, by = "Average.Age", all = TRUE)