Re: [Rd] stringsAsFactors and type.convert()

2020-04-20 Thread Martin Maechler
rgument ... which may be a good idea anyway, alerting the user when changing default behavior. > All the best, > Arni thank you, the same to you, Martin > > From: Martin Maechler > Sent: Monday, April 20, 2020 6:23:31 PM

Re: [Rd] stringsAsFactors and type.convert()

2020-04-20 Thread Arni Magnusson
. Looking forward to the 4.0.0 official release - all positive changes! All the best, Arni From: Martin Maechler Sent: Monday, April 20, 2020 6:23:31 PM To: Arni Magnusson Cc: r-devel@r-project.org Subject: Re: [Rd] stringsAsFactors and type.convert() >>&g

Re: [Rd] stringsAsFactors and type.convert()

2020-04-20 Thread Martin Maechler
> Arni Magnusson > on Mon, 13 Apr 2020 22:20:19 + writes: > If read.table() is defaulting to "character" instead of "factor" data type, shouldn't type.convert() also default to "character" in R 4.0.0? > This would seem like a good time to change the default to type.conve

[Rd] stringsAsFactors and type.convert()

2020-04-13 Thread Arni Magnusson
If read.table() is defaulting to "character" instead of "factor" data type, shouldn't type.convert() also default to "character" in R 4.0.0? This would seem like a good time to change the default to type.convert(as.is=TRUE), to align it with the new default in read.table and data.frame. I think

Re: [Rd] stringsAsFactors

2020-04-13 Thread Henrik Bengtsson
While at it, would it be worth mentioning in the NEWS for R 4.0.0 that options 'stringsAsFactors' is being deprecated, e.g. $ options(stringsAsFactors = TRUE) Warning message: In options(stringsAsFactors = TRUE) : 'options(stringsAsFactors = TRUE)' is deprecated and will be disabled ? Currentl

Re: [Rd] stringsAsFactors

2020-04-13 Thread Martin Maechler
> Hugh Parsonage > on Mon, 13 Apr 2020 21:20:26 +1000 writes: > Further, in addition to the `val <- FALSE` patch a few hours ago by > Martin, the line after should also be changed > - if(!is.logical(val) || is.na(val) || length(val) != 1L) > + if(!is.logical(val) || l

Re: [Rd] stringsAsFactors

2020-04-13 Thread peter dalgaard
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

Re: [Rd] stringsAsFactors

2020-04-13 Thread Hugh Parsonage
Further, in addition to the `val <- FALSE` patch a few hours ago by Martin, the line after should also be changed - if(!is.logical(val) || is.na(val) || length(val) != 1L) + if(!is.logical(val) || length(val) != 1L || is.na(val)) ## Consider Sys.setenv("_R_CHECK_LENGTH_1_LOGIC2_" = "TRUE") option

Re: [Rd] stringsAsFactors

2020-04-13 Thread Karolis Koncevičius
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: > T

Re: [Rd] stringsAsFactors

2020-04-13 Thread Martin Maechler
> 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

[Rd] stringsAsFactors

2020-04-12 Thread Duncan Murdoch
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, set

Re: [Rd] stringsAsFactors

2013-02-13 Thread Nicholas Crookston
ll >>>> >>>>> shows up. If f is set to be a factor, an error is generated: >>>>> >>>>> Error in model.frame.default(Terms, newdata, na.action = na.action, >>>>> xlev = >>>>> object$xlevels) : >>>&g

Re: [Rd] stringsAsFactors

2013-02-13 Thread Duncan Murdoch
l-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Terry Therneau Sent: Monday, February 11, 2013 5:50 AM To: r-devel@r-project.org; Duncan Murdoch Subject: Re: [Rd] stringsAsFactors I think your idea to remove the warnings is excellent, and a good compromise. Charac

Re: [Rd] stringsAsFactors

2013-02-13 Thread Milan Bouchet-Valat
t; > > > > I do think that it's unfortunate that we don't get the same result in both > > > cases, and I'd like to have gotten the predictions you suggested, but I > > > don't think that's going to happen. The reason for the difference is tha

Re: [Rd] stringsAsFactors

2013-02-13 Thread Duncan Murdoch
CO Software wdunlap tibco.com -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Terry Therneau Sent: Monday, February 11, 2013 5:50 AM To: r-devel@r-project.org; Duncan Murdoch Subject: Re: [Rd] stringsAsFactors I think your idea to re

Re: [Rd] stringsAsFactors

2013-02-13 Thread Ista Zahn
ro. In this particular model, we could still do >> > predictions >> > for the other levels, but it also seems reasonable to quit, given that >> > clearly something has gone wrong. >> > >> > I do think that it's unfortunate that we don't get the

Re: [Rd] stringsAsFactors

2013-02-13 Thread Michael Dewey
gt; is unavoidable without really big changes. > > Duncan Murdoch > > > >> >> Bill Dunlap >> Spotfire, TIBCO Software >> wdunlap tibco.com >> >> > -Original Message- >> > From: r-devel-boun...@r-project.org >> >

Re: [Rd] stringsAsFactors

2013-02-12 Thread Ista Zahn
fference is that > the subsetting is done before the conversion to a factor, but I think that > is unavoidable without really big changes. > > Duncan Murdoch > > > >> >> Bill Dunlap >> Spotfire, TIBCO Software >> wdunlap tibco.com >> >> >

Re: [Rd] stringsAsFactors

2013-02-11 Thread Terry Therneau
Peter, I had an earlier response to Duncan that I should have copied to the list. The subset issue can be fixed. When the model changes character to factor, it needs to remember the levels; just like it does with the factors. We are simply seeing a reprise of problems that occured whem mode

Re: [Rd] stringsAsFactors

2013-02-11 Thread peter dalgaard
On Feb 11, 2013, at 18:50 , Duncan Murdoch wrote: > > I do think that it's unfortunate that we don't get the same result in both > cases, and I'd like to have gotten the predictions you suggested, but I don't > think that's going to happen. The reason for the difference is that the > subsett

Re: [Rd] stringsAsFactors

2013-02-11 Thread Duncan Murdoch
e > conversion to a factor, but I think that is unavoidable without really big changes. > > Duncan Murdoch > > >> >> Bill Dunlap >> Spotfire, TIBCO Software >> wdunlap tibco.com >> >> > -Original Message- >> > From: r-devel-boun..

Re: [Rd] stringsAsFactors

2013-02-11 Thread Brian Diggs
On 2/11/2013 5:50 AM, Terry Therneau wrote: I think your idea to remove the warnings is excellent, and a good compromise. Characters already work fine in modeling functions except for the silly warning. It is interesting how often the defaults for a program reflect the data sets in use at the t

Re: [Rd] stringsAsFactors

2013-02-11 Thread Terry Therneau
al Message- > From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf > Of Terry Therneau > Sent: Monday, February 11, 2013 5:50 AM > To: r-devel@r-project.org; Duncan Murdoch > Subject: Re: [Rd] stringsAsFactors > > I think your idea to remove

Re: [Rd] stringsAsFactors

2013-02-11 Thread Duncan Murdoch
really big changes. Duncan Murdoch Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf > Of Terry Therneau > Sent: Monday, February 11, 2013 5:50 AM > To: r-devel@r

Re: [Rd] stringsAsFactors

2013-02-11 Thread William Dunlap
1 2 3 4 NA NA NA 28 29 30 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On > Behalf > Of Terry Therneau > Sent: Monday, February 11, 2013 5:50 AM > To: r-devel@r-project.or

Re: [Rd] stringsAsFactors

2013-02-11 Thread Terry Therneau
I think your idea to remove the warnings is excellent, and a good compromise. Characters already work fine in modeling functions except for the silly warning. It is interesting how often the defaults for a program reflect the data sets in use at the time the defaults were chosen. There are so

Re: [Rd] stringsAsFactors .... in expand.grid() etc

2009-05-20 Thread Rolf Turner
On 20/05/2009, at 1:49 AM, Martin Maechler wrote: "RT" == Rolf Turner on Tue, 19 May 2009 11:02:08 +1200 writes: RT> While we're at it --- would it not make sense to have the RT> stringsAsFactors RT> argument (once it's working) of expand.grid() default to option

Re: [Rd] stringsAsFactors .... in expand.grid() etc

2009-05-19 Thread Martin Maechler
> "RT" == Rolf Turner > on Tue, 19 May 2009 11:02:08 +1200 writes: RT> On 19/05/2009, at 10:20 AM, Steve Lianoglou wrote: >> Hi all, >> >> I've (tried) to look through the bug tracker, and gmane-search the >> R list to >> see if this has been mentioned befo

Re: [Rd] stringsAsFactors = FALSE

2008-11-17 Thread Martin Maechler
>>>>> "WD" == William Dunlap <[EMAIL PROTECTED]> >>>>> on Mon, 17 Nov 2008 09:06:49 -0800 writes: >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of >> hadley wickham Sent: Monday, Novembe

Re: [Rd] stringsAsFactors = FALSE

2008-11-17 Thread Peter Dalgaard
William Dunlap wrote: but I'm not sure why they are being converted to factors in the first place. I think expand.grid converts input strings to factors so they retain the order they have in the input. Yep. These things do matter. Incidentally, I recently got burned by cooking an example u

Re: [Rd] stringsAsFactors = FALSE

2008-11-17 Thread hadley wickham
On Mon, Nov 17, 2008 at 9:03 AM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Mon, 17 Nov 2008, hadley wickham wrote: > >> Hi all, >> >> I love the option to not automatically convert strings into factors, >> but there are three places that the current option doesn't work where >> I think it s

Re: [Rd] stringsAsFactors = FALSE

2008-11-17 Thread hadley wickham
On Mon, Nov 17, 2008 at 11:06 AM, William Dunlap <[EMAIL PROTECTED]> wrote: >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of hadley wickham >> Sent: Monday, November 17, 2008 5:10 AM >> To: r-devel@r-project.org >> Subject: [Rd] stringsAsFac

Re: [Rd] stringsAsFactors = FALSE

2008-11-17 Thread Prof Brian Ripley
On Mon, 17 Nov 2008, Prof Brian Ripley wrote: On Mon, 17 Nov 2008, hadley wickham wrote: Hi all, I love the option to not automatically convert strings into factors, but there are three places that the current option doesn't work where I think it should: Perhaps you mean 'when I would like

Re: [Rd] stringsAsFactors = FALSE

2008-11-17 Thread William Dunlap
> From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of hadley wickham > Sent: Monday, November 17, 2008 5:10 AM > To: r-devel@r-project.org > Subject: [Rd] stringsAsFactors = FALSE > ... > The key lines in > expand.grid would seem to be > >

Re: [Rd] stringsAsFactors = FALSE

2008-11-17 Thread Prof Brian Ripley
On Mon, 17 Nov 2008, hadley wickham wrote: Hi all, I love the option to not automatically convert strings into factors, but there are three places that the current option doesn't work where I think it should: Perhaps you mean 'when I would like it to'? Things *should* work as documented, s

[Rd] stringsAsFactors = FALSE

2008-11-17 Thread hadley wickham
Hi all, I love the option to not automatically convert strings into factors, but there are three places that the current option doesn't work where I think it should: options(stringsAsFactors = FALSE) str(expand.grid(letters)) str(type.convert(letters)) df <- read.fwf(textConnection(paste(letter