File: encodeToZeroIndexed.Rd

package info (click to toggle)
r-cran-blockmodeling 1.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 932 kB
  • sloc: ansic: 2,031; f90: 952; sh: 13; makefile: 5
file content (24 lines) | stat: -rw-r--r-- 645 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/encodeToZeroIndexed.R
\name{encodeToZeroIndexed}
\alias{encodeToZeroIndexed}
\title{Encode Integer Vector with Consecutive Values Starting from 0}
\usage{
encodeToZeroIndexed(x)
}
\arguments{
\item{x}{An integer vector.}
}
\value{
An integer vector with values from 0 to (number of unique values - 1),
maintaining the original order structure.
}
\description{
This function maps an integer vector to a new vector where the unique values
are replaced with consecutive integers starting from 0.
}
\examples{
encodeToZeroIndexed(c(10, 20, 10, 30))
# Returns: 0 1 0 2

}