r transpose data frame code example Example: r transpose dataframe iris_transpose <- as.data.frame(t(as.matrix(iris_df))) iris_transpose