Entering edit mode
5.4 years ago
erick_rc93
▴
30
I want to merge two data.frames in R, the first one is a data frame with 50,000 rows and 95 columns and the second one has only 1 row and 95 columns, I'm using the rbind function, but I'm not sure how this function works, for example, Is necessary that both colnames in data frames are sorted or it doesn't matter ?
data_2 <- data.frame(1:50000, 1:95 )
vector <- read.table(file = "vector_binary.csv",header = T,sep = ",",row.names = 1,check.names = F)
vector_t <- data.frame(t(vector),check.names = F)
dummy_variable_1 <- data.frame(vector_hip_t[order(colnames(data_2))],check.names = F)
row.names(dummy_variable_1) <- "1_dummy.faa"
data_2 <- rbind(data_2,dummy_variable_1)
write.csv(x = data_2,file = "pangenome_matrix_t0.tr_3.csv")