3 ms·
Thanks to readr's stringsAsFactors=F default, I've fortunately been avoiding unexpected issues due to factoring. However, the default R functions still load da
by minimaxir 11y ago
Thanks to readr's stringsAsFactors=F default, I've fortunately been avoiding unexpected issues due to factoring.
However, the default R functions still load data as factors and I have bad memories of that catching me by surprise, particularly when performing mathematical operations on vectors which are secretly factors and silently getting wrong results.
I still need to use factors with ggplot2 though for discrete orders. (E.g bar chart sorting)
- hadley 11y agoYeah I've been thinking about making a new class based on top of character vectors that allows custom ordering
- rabboRubble 11y agoAfter much frustration with a project I'm working on, yesterday I stumbled across using data.frame instead of cbind. Are you maybe Hadley Wickham? If yes, you probably already know this :-) My brother bought me "Advanced R" for Christmas. edit: data.frame, not read.table
- washedup 11y agoSo glad that stringsAsFactors exists. Saves me a lot of time.