I use following code:
tempdata <- rbind(tempdata,newdata) # bind rowwise
as far as I know, tempdata (like all objects, variables, ...) needs to be defined. Because there are only numerical values, I define it as tempdata<-0
. It's not a really big problem, but when using rbind afterwards, the first row with 0
is kept at the first place and I have to use some kind of
tempdata<-tempdata[-1,] # deletes first row
I can't define it as tempdata<-''
, because this would be a character, right?
Well as I said, not really a problem for me, but would there be a better way, especially if I or someone would use rbind()
many times in the code and therefore maybe the first row has to be "cleared" not only once...
The same could be a problem when using cbind()
.
Maybe someone knows a better solution?