I have issues getting the output I want from a data.frame. The structure of the data is the following:
head(test) A T L B E X D 4 no no no yes no no yes 7 no no no no no no no 11 no no no no no no no 12 no no no yes no no yes 17 no no no no no no no 27 no no no no no no no The output I get:
test[1,] A T L B E X D 4 no no no yes no no yes The output I want:
[1] "no" "no" "no" "yes" "no" "no" "yes" Or simply, the output I want is a vector where each element is a string value of that column in the df. I could do a for loop or some stupid thing like that, but I belive there should be a much simpler way that I am missing.
I have tried:
as.character(test[1,]) [1] "1" "1" "1" "2" "1" "1" "2" Not sure what I am missing here?