Converting two columns of a data frame to a named vector

后端 未结 6 1110
無奈伤痛
無奈伤痛 2020-11-29 06:31

I need to convert a multi-row two-column data.frame to a named character vector. My data.frame would be something like:

dd = data.         


        
6条回答
  •  醉酒成梦
    2020-11-29 06:45

    You can also use deframe(x) from the tibble package for this.

    tibble::deframe()
    

    It converts the first column to names and second column to values.

提交回复
热议问题