-2
두 데이터 프레임을 어떻게 신속하게 병합 할 수 있습니까? dataframes두 데이터 프레임의 열을 병합
df1<-data.frame(a=(1:5),b=(1:5))
df2<-data.frame(c=(1:5),d=(1:5))
위한 출력 :
output<-data.frame(a=(1:5),b=(1:5),c=(1:5),d=(1:5))
두 데이터 프레임을 어떻게 신속하게 병합 할 수 있습니까? dataframes두 데이터 프레임의 열을 병합
df1<-data.frame(a=(1:5),b=(1:5))
df2<-data.frame(c=(1:5),d=(1:5))
위한 출력 :
output<-data.frame(a=(1:5),b=(1:5),c=(1:5),d=(1:5))
당신은`cbind를 사용
cbind.data.frame(df1,df2)
a b c d
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
5 5 5 5 5
또는
cbind2(df1,df2)
a b c d
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
5 5 5 5 5
이 are not "* 기타 기능 * ". 'cbind.data.frame'은'data.frame' 입력시'cbind '에 의해 자동으로 호출되는'data.frame' * 메소드입니다. 어떤 조건이 충족되면'cbind2'도'cbind'에 의해 호출됩니다. 이 답변은 유용한 IMO보다 혼란 스럽습니다. OP는'? cbind'를 읽을 필요가 있습니다. –
같은 다른 기능을 사용하여이 작업을 시도 할 수 있습니다()' – mtoto