I have a table called test (imported with read.csv) that looks like this:
Y X1 X2 ... X100
0 125 a ... 32
1 163 b ... 25
0 758 b ... 587
I have succeeded saving all the predictors in a different table with the following command:
x_test <- test[, !(colnames(test) %in% c("Y"))]
When I type
fix(x_test)
I get a beautiful table with all the predictors. I cannot seem to do the same for Y. Any help?
Hope this is helpful. Insufficient rep to ask for information in a comment, so I'll jump in with something. I don't know what class your loaded object is (or the columns therein), but you might try ensuring it's a data frame, then using subset:
using the subset may not be the best way, but has the advantage that even when extracting a single column (as in the case of your "Y") the result will be a data frame, rather than a vector.
EDIT: props to Sven who I just saw enquired about the class (didn't see before posting this)