How to combine multiple character columns into a single column in an R data frame

前端 未结 6 827
挽巷
挽巷 2020-12-03 01:10

I am working with Census data and I need to combine four character columns into a single column.

Example:

LOGRECNO STATE COUNTY  TRACT BLOCK
    60           


        
6条回答
  •  日久生厌
    2020-12-03 02:02

    You can use tidyverse package:

    DF %>% unite(new_var, STATE, COUNTY, TRACT, BLOCK)
    

提交回复
热议问题