[R] Generating unque patient IDs

Chris Campbell ccampbell at mango-solutions.com
Wed Jan 11 18:39:40 CET 2012


Dear Ayyappa

Unique identifiers can be created from numbers using factor. These are coded as integers in R which you could use to relabel your dataset.

> x <- rep(1000000006:1000000008, each = 2)
> x
[1] 1000000006 1000000006 1000000007 1000000007 1000000008 1000000008
> y <- factor(x)
> levels(y)
[1] "1000000006" "1000000007" "1000000008"
> z <- as.numeric(y)
> z
[1] 1 1 2 2 3 3

Regards, 

Chris Campbell
MANGO SOLUTIONS
Data Analysis that Delivers
+44 1249 767700

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Ayyappa Chaturvedula
Sent: 11 January 2012 16:12
To: r-help at r-project.org
Subject: [R] Generating unque patient IDs

Dear group,

I am trying to prepare a NONMEM friendly dataset for population PK analysis. My patient IDs are 10 digit long and NONMEM is losing precison and rouding the last couple of digits.  I need to generate unique Patient IDs fromt he current 10-digit IDs.  Ihave total 250 subjects so I appreciate if anybody can suggest me a way to code this in R.

Regards,
Ayyappa

	[[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
LEGAL NOTICE
This message is intended for the use o...{{dropped:10}}



More information about the R-help mailing list