You can pad the shorter vectors with some value, perhaps NA, to match the length of the longest vector.
X <- 1:4
Y <- 1:6
data.frame(X,Y)
Error in data.frame(X, Y) :
arguments imply differing number of rows: 4, 6
Xnew <- c(X, rep(NA,2))
data.frame(Xnew,Y)
Xnew Y
1 1 1
2 2 2
3 3 3
4 4 4
5 NA 5
6 NA 6
However, this seems like a bad idea. The purpose of a data frame row is to hold values that are associated in some way. Why do you need to force the data together?