blk.sequentialID: Create a Sequential ID

View source: R/PCSmisc.R

blk.sequentialIDR Documentation

Create a Sequential ID

Description

A new ID that numbers individuals sequentially starting at 1 is generated from an existing ID.

Usage

blk.sequentialID(id)

Arguments

id

A valid block-format ID.

Details

An ID is a factor that designates blocks in a block-format data set. This function takes an existing ID and generates a new one that preserves the same structure but is numeric and sequential starting at 1. Thus, this is a means of transforming an ID that is desciptive and alphanumeric into one that can be used with NONMEM.

Value

A valid block-format ID.

Author(s)

Benjamin Rich <mail@benjaminrich.net>

See Also

block-format

Examples

require(nlme)
data(Phenobarb)
dat <- Phenobarb[1:56,]  # First 4 subjects
attach(dat)

cbind(dat, newID=blk.sequentialID(asID(Subject)))

detach(dat)

benjaminrich/PCSmisc documentation built on Feb. 11, 2024, 9:25 p.m.