[R] unlist( list( factor( 'a'), 1)) == c( 1, 1); unlist( list( factor( 'a'), factor( 1)))==c( 'a', '1')

2014-03-30 Thread Frank Schwidom
Hi, c( factor( 'a'), ( 1)) [1] 1 1 c( factor( 'a'), factor( 1)) [1] 1 1 c( factor( 'a'), factor( 'b')) [1] 1 1 unlist( list( factor( 'a'), 1)) [1] 1 1 unlist( list( factor( 'a'), factor( 1))) [1] a 1 Levels: a 1 unlist( list( factor( 'a'), factor( 'b'))) [1] a b Levels: a b In an

Re: [R] unlist( list( factor( 'a'), 1)) == c( 1, 1); unlist( list( factor( 'a'), factor( 1)))==c( 'a', '1')

2014-03-30 Thread Jeff Newmiller
This is definitely not an error, all these behaviours are by design. You need to (re)read the description of factors in the Introduction to R document that comes with the software. Factors are not optimized versions of strings, they are finite sets of category information designed for use in