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
YtrainandXtrain? You write that you have a matrix, which I assume isXtrain. IsYtrainalso a matrix? Or do both objects come from one original matrix? I ask becauseYtrainmight get recycled if it is shorter thannrow(Xtrain).