Transposing in dplyr

后端 未结 4 792
故里飘歌
故里飘歌 2021-02-02 14:04

I have the following data.frame

df = structure(list(HEADER = c(\"HOME_TRPM\", \"AWAY_TRPM\", \"HOME_TEAM\",\"AWAY_TEAM\"),
                     price = c(\"0.863         


        
4条回答
  •  梦毁少年i
    2021-02-02 14:12

    Using tibble package (of the tidyverse family), you can eliminate the undesirable effects of t().

     df_t = as_tibble(t(df), rownames = "row_names")
    

提交回复
热议问题