NotFromMe: stringsAsFactors: An unauthorized biography
This is not written by me. I just copy and paste it here. The origninal link is : http://simplystatistics.org/2015/07/24/stringsasfactors-an-unauthorized-biography/ Recently, I was listening in on the conversation of some colleagues who were discussing a bug in their R code. The bug was ultimately traced back to the well-known phenomenon that functions like ‘read.table()’ and ‘read.csv()’ in R convert columns that are detected to be character/strings to be factor variables. This lead to the spontaneous outcry from one colleague of Why does stringsAsFactors not default to FALSE???? The argument ‘stringsAsFactors’ is an argument to the ‘data.frame()’ function in R. It is a logical that indicates whether strings in a data frame should be treated as factor variables or as just plain strings. The argument also appears in ‘read.table()’ and related functions because of the role these functions play in reading in table data and converting them to data frames. By default, ‘strin