From gregor.gorjanc at bfro.uni-lj.si  Wed Mar 15 06:32:01 2006
From: gregor.gorjanc at bfro.uni-lj.si (Gregor Gorjanc)
Date: Wed, 15 Mar 2006 06:32:01 +0100
Subject: [Rd] Internal codes of the factor
In-Reply-To: <17431.31792.677194.884181@bossiaea.maths.uwa.edu.au>
References: <44169B27.9020908@bfro.uni-lj.si>
	<17431.31792.677194.884181@bossiaea.maths.uwa.edu.au>
Message-ID: <4417A6D1.3020200@bfro.uni-lj.si>

Berwin A Turlach wrote:
> G'day Gregor,
> 
> 
>>>>>>"GG" == Gregor Gorjanc <gregor.gorjanc at bfro.uni-lj.si> writes:
> 
> 
>     GG> I am writing some functions and I repeatedly acces internal
>     GG> factor codes. I figured out that internal codes are 1:n where
>     GG> 1 represents 1st level, 2 2nd level etc. This is not
>     GG> documented [...]
> The help page for factor states in the 'Details' section:
> 
>      The encoding of the vector happens as follows. First all the
>      values in 'exclude' are removed from 'levels'. If 'x[i]' equals
>      'levels[j]', then the 'i'-th element of the result is 'j'.  If no
>      match is found for 'x[i]' in 'levels', then the 'i'-th element of
>      the result is set to 'NA'.
> 
> Note in particular the part on "then the 'i'-th element of the result
> is 'j'".  This pretty much documents that the internal codes are 1:n
> and 'NA', as documented in the following sentence.

Thanks for this pointer to documentation.

-- 
Lep pozdrav / With regards,
    Gregor Gorjanc

----------------------------------------------------------------------
University of Ljubljana     PhD student
Biotechnical Faculty
Zootechnical Department     URI: http://www.bfro.uni-lj.si/MR/ggorjan
Groblje 3                   mail: gregor.gorjanc <at> bfro.uni-lj.si

SI-1230 Domzale             tel: +386 (0)1 72 17 861
Slovenia, Europe            fax: +386 (0)1 72 17 888

----------------------------------------------------------------------
"One must learn by doing the thing; for though you think you know it,
 you have no certainty until you try." Sophocles ~ 450 B.C.



[Rd] Internal codes of the factor
Gregor Gorjanc