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

前端 未结 6 817
挽巷
挽巷 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:08

    You can try this too

    AL_Blocks <- transform(All_Blocks, BLOCKID = paste(STATE,COUNTY,
                           TRACT, BLOCK, sep = "")
    

提交回复
热议问题