r 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
>>
>> if (!is.factor(x) && is.character(x)) x <- factor(x,
>> levels = unique(x))
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
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
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
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
> 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
>
>
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
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