Convert a row of a data frame to vector
When you extract a single row from a data frame you get a one-row data frame. Convert it to a numeric vector: As @Roland suggests, unlist(df[1,]) will convert the one-row data frame to a numeric vector without dropping the names. Therefore unname(unlist(df[1,])) is another, slightly more explicit way to get to the same result. As … Read more