From pd@|gd @end|ng |rom gm@||@com  Mon Apr 13 13:57:43 2020
From: pd@|gd @end|ng |rom gm@||@com (peter dalgaard)
Date: Mon, 13 Apr 2020 13:57:43 +0200
Subject: [Rd] stringsAsFactors
In-Reply-To: <20200413110143.idokusxryi3ihrfm@PMW>
References: <e9c057e7-9c64-38ff-c936-fea6c1437b1c@gmail.com>
 <24212.6954.256734.135105@stat.math.ethz.ch>
 <20200413110143.idokusxryi3ihrfm@PMW>
Message-ID: <BB79BD3F-D223-4E1D-BA53-ADBD99AC8352@gmail.com>

In both cases, that is as it should be. 

1. expand.grid() (sic) has its main application in factorial designs, for which you want a set of factors

2. tables are factorial structures by nature. Converting factors to character would lose level order (true for 1. as well, actually)

- pd 

> On 13 Apr 2020, at 13:01 , Karolis Koncevi?ius <karolis.koncevicius at gmail.com> wrote:
> 
> Hello,
> 
> I also want to report 2 missed cases of stringsAsFactors=TRUE in base:
> 
> 1. grid.expand() still uses hard stringsAsFactors=TRUE in its arguments.
> 2. as.data.frame.table() also keeps factors after conversion from table.
> 
>>>>>>> Duncan Murdoch
>>>>>>>    on Sun, 12 Apr 2020 08:57:14 -0400 writes:
>> 
>>   > The NEWS for R 4.0.0 says "R now uses a stringsAsFactors = FALSE
>>   > default, and hence by default no longer converts strings to factors in
>>   > calls to data.frame() and read.table()."
>> 
>>   > This seems to have been implemented by setting options(stringsAsFactors
>>   > = FALSE) in the main R profile.  However, setting
>> 
>>   > options(stringsAsFactors = NULL)
>> 
>>   > reverts to the same behavior as the old options(stringsAsFactors =
>>   > TRUE).  Is this intentional?
>> 
>> 
>> No!  Thanks a lot for testing R 4.0.0 alpha/beta, noticing and
>> alerting us about it.
>> 
>> This will be changed ASAP.
>> 
>> ... and it will benefit the whole R user community if quite a
>> few good R users (as most readers of 'R-devel') would start
>> using 'R 4.0.0 beta' routinely now --- thanks a lot in advance!
>> 
>> Martin
>> 
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] stringsAsFactors
peter dalgaard