I just noticed that a new feature in R 2.4 is that unlist of a list of
factors
already does the operation that I proposed :
> x = factor(letters[1:5])
> y = factor(letters[4:8])
> unlist(list(x,y))
[1] a b c d e d e f g h
Levels: a b c d e f g h
>
Therefore, does it not make sense that c(x,y) s
I noticed that a new feature in R 2.4 is that unlist of a list of factors
already does the operation that I proposed :
> x = factor(letters[1:5])
> y = factor(letters[4:8])
> unlist(list(x,y))
[1] a b c d e d e f g h
Levels: a b c d e f g h
>
Therefore, does it not make sense that c(x,y) shoul
On Wed, 15 Nov 2006, Barry Rowlingson wrote:
>
> >
> > It does not remove names in Splus either, just all
> > other attributes. I see c() used in several Splus
> > functions as a way to convert a matrix into a vector
> > (by removing the .Dims and .Dimnames attributes).
> >
>
> I dont see t
>
> It does not remove names in Splus either, just all
> other attributes. I see c() used in several Splus
> functions as a way to convert a matrix into a vector
> (by removing the .Dims and .Dimnames attributes).
>
I dont see the logic in certain attribute names (?attr lists 'class',
'comm
> > In addition, c() has always had a double meaning of
> > (a) turning an object into a simple "vector" (an object
> > without "attributes"), as in
> > > c(factor(c("Cat","Dog","Cat")))
> > [1] 1 2 1
> > > c(data.frame(x=1:2,y=c("Dog","Cat")))
> > $x
> > [1] 1 2
> >
> Just for clarification, my interest was only to provide an
> alternative that provided for a more generic approach, at
> least in a narrow application, not that I was advocating it's
> need.
Understood, apologies for falsely implying your advocation.
> I would agree with Prof. Ripley's comm
On Wed, 2006-11-15 at 12:51 +, Matthew Dowle wrote:
> I have a solution which works for me, and I have contributed it. One
> other person has shown some interest, and taken it further to work with
> multiple arguments which looks like a nice improvement.
Just for clarification, my interest
s case, which is why I avoided it in
the solution I posted.
Regards,
Matthew
> -Original Message-
> From: Prof Brian Ripley [mailto:[EMAIL PROTECTED]
> Sent: 14 November 2006 18:23
> To: Marc Schwartz
> Cc: Matthew Dowle; r-devel@r-project.org
> Subject: Re: [Rd] c.fa
On Tue, 14 Nov 2006, Bill Dunlap wrote:
> On Tue, 14 Nov 2006, Prof Brian Ripley wrote:
>
>> Well, R has managed without a factor method for c() for most of its decade
>> of existence (not that it originally had factors as we know them).
>>
>> I would argue that factors are best viewed as an enume
On Tue, 14 Nov 2006, Prof Brian Ripley wrote:
> Well, R has managed without a factor method for c() for most of its decade
> of existence (not that it originally had factors as we know them).
>
> I would argue that factors are best viewed as an enumeration type, and
> anything which silently chang
On Tue, 2006-11-14 at 16:36 +, Matthew Dowle wrote:
> Hi,
>
> Given factors x and y, c(x,y) does not seem to return a useful result :
> > x
> [1] a b c d e
> Levels: a b c d e
> > y
> [1] d e f g h
> Levels: d e f g h
> > c(x,y)
> [1] 1 2 3 4 5 1 2 3 4 5
> >
>
> Is there a case for a new m
Well, R has managed without a factor method for c() for most of its decade
of existence (not that it originally had factors as we know them).
I would argue that factors are best viewed as an enumeration type, and
anything which silently changes their level set is a bad idea. I can see
a case f
On Tue, 2006-11-14 at 11:51 -0600, Marc Schwartz wrote:
> On Tue, 2006-11-14 at 16:36 +, Matthew Dowle wrote:
> > Hi,
> >
> > Given factors x and y, c(x,y) does not seem to return a useful result :
> > > x
> > [1] a b c d e
> > Levels: a b c d e
> > > y
> > [1] d e f g h
> > Levels: d e f g h
13 matches
Mail list logo