How to combine two dataframes in the correct order using R

1
df <- read.csv('train.csv')  
train1 <- train[train$variavel3 == 1]  
train2 <- train[train$variavel3 == 0]  
fit1 <- rpart(variavel1~variavel2)  
fit2 <- rpart(variavel1~variavel2)  
dftest <- read.csv('test.csv')  
dftest1 <- test[test$variavel3 == 1]  
dftest2 <- test[test$variavel3 == 0]  
prediction1 <- predict(fit1, dftest1)  
prediction2 <- predict(fit2, dftest2)   

dataframe1 ------------- dataframe2
x1 --- x2 ----------------- x1 ------ x2
1 ---- 0 ------------------- 2 ------- 0
3 ---- 0 ------------------- 4 ------- 1
6 ---- 1 ------------------- 5 ------- 1

I want to merge the dataframes so that x1 is in the correct order

    
asked by anonymous 07.11.2016 / 18:15

1 answer

1

I got the answer. I joined the two date frames with an rbind ()
and then I used a arrange () to sort the way I wanted. Many thanks for all your help

    
07.11.2016 / 19:32