Answers for "how to convert matrix to vector in r"

R
0

how to convert matrix to numeric in r

apply(extra4, 2, as.numeric)
sapply(extra4, as.numeric)
class(extra4) <- "numeric"
storage.mode(extra4) <- "numeric"
Posted by: Guest on May-17-2020
0

convert a matrix to a vector in r

as.vector(my_mat)                    # Applying as.vector function
Posted by: Guest on August-23-2021

Browse Popular Code Answers by Language