How to Transpose a DataFrame in R
To transpose a DataFarme in R using the t() function: Copy transposed_df <- t(df) Example of Transposing a DataFrame in R Given the following DataFrame in R: Copy df <- data.frame(product = c(“computer”, “monitor”, “keyboard”, “printer”, “tablet”), price = c(800, 450, 100, 150, 300), brand = c(“A”, “B”, “C”, “X”, “Y”) ) print(df) The current … Read more