Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

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

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')

ff

Memory-Efficient Storage of Large Data on Disk and Fast Access Functions

v4.0.4
GPL-2 | GPL-3 | file LICENSE
Authors
Daniel Adler [aut], Christian Gläser [aut], Oleg Nenadic [aut], Jens Oehlschlägel [aut, cre], Martijn Schuemie [aut], Walter Zucchini [aut]
Initial release
2020-10-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.