convert a row to a column in r

# Create a sample data frame
data <- data.frame(A = c(1, 2, 3), B = c(4, 5, 6))

# Convert the row to a column using the t() function
transposed_data <- as.data.frame(t(data))

# Set the names of the transposed data frame
names(transposed_data) <- NULL