Learn R Programming

ff (version 4.0.4)

ram2ffcode: 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

Value

A vector of integer values representing the correspnding factor levels.

Details

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

See Also

factor, levels.ff, vmode

Examples

Run this code
# NOT RUN {
 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')
# }

Run the code above in your browser using DataLab