Transpose dataframe
transpose_dataframe__.Rd
This function transposes a provided data frame, using the values from the first column as new column names.
Details
The expected input is a data frame where the first column serves as Time
, and the subsequent columns contain observations for various features.
Examples
a <- data.frame("Day"=c("Day1","Day2","Day3"),"feature_1" =c(1,2,3),"feature_2" =c(0,4,1),"feature_3" =c(1,1,0))
a
#> Day feature_1 feature_2 feature_3
#> 1 Day1 1 0 1
#> 2 Day2 2 4 1
#> 3 Day3 3 1 0
transpose_dataframe__(a)
#> Day1 Day2 Day3
#> 1 1 2 3
#> 2 0 4 1
#> 3 1 1 0