R: Factor codings

ram2ffcode {ff} | R Documentation

## Factor codings

### Description

Function `ram2ffcode` creates the internal factor codes used by ff to store factor levels. Function `ram2ramcode` is a compatibility function used instead if `RETURN_FF==FALSE`.

### Usage

    ram2ffcode(value, levels, vmode)
    ram2ramcode(value, levels)

### Arguments

`value` | factor or character vector of values
`levels` | character vector of factor levels
`vmode` | one of the integer vmodes in `.rammode`

### Details

Factors stored in unsigned vmodes `.vunsigned` have their first level represented as 0L instead of 1L.

### Value

A vector of integer values representing the correspnding factor levels.

### Author(s)

Jens Oehlschlägel

### See Also

`factor`, `levels.ff`, `vmode`

### Examples

     ram2ffcode(letters, letters, vmode="byte")
     ram2ffcode(letters, letters, vmode="ubyte")
     ram2ffcode(letters, letters, vmode="nibble")
     message('note that ram2ffcode() does NOT warn that vmode="nibble" cannot store 26 levels')

[Package ff version 2.2-13 Index]