0

I have two data frame one with 50000 observation and 23 variables other one with 49999 observation and 1 variable. when I try to bind I'm getting the following error,

Error in $<-.data.frame(*tmp*, churn, value = list(churn$X.1 = c(1L, : replacement has 49999 rows, data has 50000

Can you help?

df1 <- read.table(".....", header = T, sep = "\t", na.strings = c('NA', ''))
df2 <- read.table("......", header = T, sep = "\t")
df1$churn <- cbind(df2)
Sotos
  • 51,121
  • 6
  • 32
  • 66

1 Answers1

0

You should use merge.

merge(df1,df2,by=c("colname to join"));
MSW Data
  • 441
  • 3
  • 8