If we want to turn a dataframe row into a character vector then we can use as.character() method In R, we can construct a character vector by enclosing the vector values in double quotation marks, but if we want to create a character vector from data frame row values, we can use the as character function.
For example, if we have a data frame df then the values in the first row of the df can be turned into character vector using as.character(df[1,]).
Syntax: as.character(df[rownum, ])
Example 1: Here we are going to turn dataframe row into a character vector.
Here we will create a dataframe and then convert it to a vector.
 "1" "1" "6"
Example 2: Converting row-wise dataframe into the vector.