powered by
ids2rownum takes a vector of ids and converts it t 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
ids2rownum(ids, data, idname)
vector of ids
data frame
unique id
vector of row numbers
# NOT RUN { ids <- seq(1,1000,length.out=100) ids <- ids[order(runif(100))] df <- data.frame(id=ids) ids2rownum(df$id, df, "id") # }
Run the code above in your browser using DataLab