assignIds: Assign an id to a list of characters or factors

View source: R/assignIds.R

assignIdsR Documentation

Assign an id to a list of characters or factors

Description

This function aims to assign an id to factor or similar character strings. Regarding factors, as.integer() does such task but the order obtained may differ.

Usage

assignIds(x, alphabetical = FALSE)

Arguments

x

an R object to be coerced into character type.

alphabetical

a logical indicating whether an alphabetical sorting must be applied.

Value

A vector of Ids.

Examples

assignIds(list(2,'f', 'd', 'f'))

letiR/letiRmisc documentation built on Sept. 11, 2022, 12:43 a.m.