[R] Adding a numeric class to a data.frame

Jeff Reichman re|chm@nj @end|ng |rom @bcg|ob@|@net
Mon Jun 5 01:11:08 CEST 2023


R-Help Community

 

How do I add a numeric class to a data .frame. 

 

For example, I have calculated the following probabilities

 

           1            2            3

0.0011566127 0.0009267028 0.0081623324

 

How would I add them back into my data.frame for example

 

My_df <- data.frame(col_1 = c('A', 'B', 'C')) such that I end up with

 

col_1                   col_2

        A  0.0011566127

 

Though I could use a cbind.

 

Jeff


	[[alternative HTML version deleted]]



More information about the R-help mailing list