str2int: strings to ints

Description Usage Arguments Details Value

View source: R/RcppExports.R

Description

This is a Rcpp implementation of R's as.integer(as.factor(strings)) - 1

Usage

1
str2int(s, out)

Arguments

s

(vector of strings)

out

(vector of integers; this is filled out by the method; same length as s)

Details

ie, it converts strings into integers (0-based) the conversion maintains the natural ordering (the first string is 0, the next new string i 1, ... )

returns number of unique elements

Value

number of distinct/unique strings


Ahhgust/MMDIT documentation built on Jan. 27, 2021, 11:48 a.m.