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

hashCode

Gets an integer hashcoded for R objects


Description

Gets an integer hashcoded for R objects.

Usage

## Default S3 method:
hashCode(object, ...)

Arguments

object

A vector or list of R objects.

...

Not used.

Details

A character string is converted into a hashcode following Java conventions by s[1]*31^(n-1) + s[2]*31^(n-2) + ... + s[n] using integer arithmetic, where s[i] is the i:th character of the string, n is the length of the string. The hash value of the empty string is zero.

For all other objects, by default as.integer() is called.

Value

Returns a vector of integer's.

Author(s)

Henrik Bengtsson


R.oo

R Object-Oriented Programming with or without References

v1.24.0
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

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