this is probably a really stupid question, but I am big R newbie and. I have a matrix, which i need to frame. Is there a better way to do this, other than:
data1 = data.frame(X0 = Ytrain, X1 = Xtrain[,2], X2 = Xtrain[,3], ... , X50 = Xtrain[,51])
?
I was able to generate this monstrosity in Emacs, but now i need to create R function that does this. Any help would be greatly appriciated.
Tomas
This ought to do it: