You need to assign the result of your function, otherwise it is not "saved" as object in your workspace. With your code:
newdata<- function(i, a, b) {
mydata_i<- data.frame(x=a, y=b)
return(mydata_i)
}
# not saved as object, just printed
newdata(1, 2, 3)
newdata(2, 4, 6)
# assign it
mydata_1 <- newdata(1, 2, 3)
mydata_2 <- newdata(2, 4, 6)
# and use it
last<- rbind(mydata_1, mydata_2)
# or use if directly
last2 <- rbind(newdata(1, 2, 3), newdata(2, 4, 6))
Hope it helps.