[R] stringsAsFactors has no impact in expand.grid()?

2009-06-25 Thread Rainer M Krug
Hi I have the feeling, that the argument stringsAsFactors has no impact in the function expand.grid: a - c(PR, NC, A2, BS) b - c(1, 0.5, 0.25, 0.125, 0.0625, 0.03125) class(expand.grid(css, fscs, stringsAsFactors=FALSE)[[1]]) [1] factor class(expand.grid(css, fscs, stringsAsFactors=TRUE)[[1]])

Re: [R] stringsAsFactors has no impact in expand.grid()?

2009-06-25 Thread Henrique Dallazuanna
I also not find this in the source code, but you can rewrite the function with this: expand.grid - function (..., KEEP.OUT.ATTRS = TRUE, stringsAsFactors = FALSE) { nargs - length(args - list(...)) if (!nargs) return(as.data.frame(list())) if (nargs == 1L is.list(a1 -

Re: [R] stringsAsFactors has no impact in expand.grid()?

2009-06-25 Thread Rainer M Krug
On Thu, Jun 25, 2009 at 1:38 PM, Henrique Dallazuanna www...@gmail.comwrote: I also not find this in the source code, but you can rewrite the function with this: That's true - but this should be fixed in the package itself. I have just converted the factor to characters. Cheers Rainer

Re: [R] stringsAsFactors has no impact in expand.grid()?

2009-06-25 Thread Gabor Grothendieck
It works for me. Try a more recent version of R. a - c(PR, NC, A2, BS) b - c(1, 0.5, 0.25, 0.125, 0.0625, 0.03125) class(expand.grid(a, b, stringsAsFactors=FALSE)[[1]]) [1] character class(expand.grid(a, b, stringsAsFactors=TRUE)[[1]]) [1] factor R.version.string [1] R version 2.9.1 RC

Re: [R] stringsAsFactors has no impact in expand.grid()?

2009-06-25 Thread Rainer M Krug
On Thu, Jun 25, 2009 at 2:55 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: It works for me. Try a more recent version of R. Good to see that it is fixed in 2.9.1. I am using the latest release and am going to wait till 2.9.1 is released. Thanks, Rainer a - c(PR, NC, A2, BS)