Factors in R: more than an annoyance?

后端 未结 7 1495
梦如初夏
梦如初夏 2020-11-28 19:30

One of the basic data types in R is factors. In my experience factors are basically a pain and I never use them. I always convert to characters. I feel oddly like I\'m missi

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 20:10

    What a snarky title!

    I believe many estimation functions allow you to use factors to easily define dummy variables... but I don't use them for that.

    I use them when I have very large character vectors with few unique observations. This can cut down on memory consumption, especially if the strings in the character vector are longer-ish.

    PS - I'm joking about the title. I saw your tweet. ;-)

提交回复
热议问题