1
Good afternoon
To help me with the problem I set up a fictitious database
dados1<-c(15,15,16,17,18,52,48,47,65,32,'',15,14)
dados2<-c(15,15,16,17,18,52,'',47,65,32,15,15,14)
dados3<-rbind(dados1,dados2)
dados3<-data.frame(dados3)
where the result of data3 is as follows:
X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13
dados1 15 15 16 17 18 52 48 47 65 32 15 14
dados2 15 15 16 17 18 52 47 65 32 15 15 14
need to transfer the empty spaces to the last column, that is to join the base, leaving empty spaces in the last column
I would pass each row to one vector, delete the empty vector, and stack again. But it’s a pretty naive solution. If no one responds in a week, send me a warning here, I’ll try
– Guilherme Parreira
Empty spaces can be interpreted as
NA
? If first empty space (X7, dates2) goes to the last column, who should occupy that slot? Describe a little more about the constraints of the problem.– bbiasi