Avoid rbind()/cbind() conversion from numeric to factor

后端 未结 3 1114
栀梦
栀梦 2021-01-30 21:20

I\'m trying to build a dataset before plotting it. I decided to use function factory gammaplot.ff() and the first version of my code looks like this:



        
3条回答
  •  太阳男子
    2021-01-30 21:27

    If I use rbind or rbind.data.frame, the columns are turned into characters every time. Even if I use stringsAsFactors = FALSE. What worked for me was using

    rbind.data.frame(df, data.frame(ColNam = data, Col2 = data), stringsAsFactors = FALSE)
    

提交回复
热议问题