Convert a dataframe to a vector (by rows) January 29, 2023 by Tarik You can try as.vector(t(test)). Please note that, if you want to do it by columns you should use unlist(test).