#对data.frame中添加一行
row=data.frame(mao.m=c("j"),mao=c("0"));#将需要添加的行构成data.frame,并且用双引号
mao1= rbind(mao[1:(j-1),],row, mao[(j):nrow(mao),]
#在集合A但是不在集合B中
setdiff(A,B)
#向添加数行
#首先将要添加的数据变成字符型。
mao = cus.data$KPI_VALUE[1:(length(cus.data$C_MONTH))]
mao.m =cus.data$C_MONTH[1:(length(cus.data$C_MONTH))]
mao1=data.frame(mao.m,mao)
m2016=c(201601:201612)
b=setdiff(m2016,mao1$mao.m)#识别在m2016中,但是不在mao1$mao.m中的数据
b=as.character(b)
row=data.frame(mao.m=b,mao=c("0","0"))
mao1= rbind(mao1,row)