ids2rownum: Convert Vector of ids into Vector of Row Numbers

Description Usage Arguments Value Examples

View source: R/BMisc.R

Description

ids2rownum takes a vector of ids and converts it to the right row number in the dataset; ids should be unique in the dataset that is, don't pass the function panel data with multiple same ids

Usage

1
ids2rownum(ids, data, idname)

Arguments

ids

vector of ids

data

data frame

idname

unique id

Value

vector of row numbers

Examples

1
2
3
4
ids <- seq(1,1000,length.out=100)
ids <- ids[order(runif(100))]
df <- data.frame(id=ids)
ids2rownum(df$id, df, "id")

BMisc documentation built on Dec. 18, 2020, 5:08 p.m.