ids2rownum {BMisc}R Documentation

Convert Vector of ids into Vector of Row Numbers

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

ids2rownum(ids, data, idname)

Arguments

ids

vector of ids

data

data frame

idname

unique id

Value

vector of row numbers

Examples

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


[Package BMisc version 1.4.6 Index]