[R] Odp: Generating unque patient IDs

2012-01-11 Thread Petr PIKAL
Hi
 
 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.

I would start with

?abbreviate
and check uniqueness with 
?unique or ?duplicated

Regards
Petr


 
 Regards,
 Ayyappa
 
[[alternative HTML version deleted]]
 
 __
 R-help@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.

__
R-help@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.


Re: [R] Odp: Generating unque patient IDs

2012-01-11 Thread jim holtman
Does this do it for you:

 sprintf(%010.0f, seq(10.0, length = 250, by = 1.0))
  [1] 10 11 12 13 14
15 16
  [8] 17 18 19 100010 100011
100012 100013
 [15] 100014 100015 100016 100017 100018
100019 100020
 [22] 100021 100022 100023 100024 100025
100026 100027
 [29] 100028 100029 100030 100031 100032
100033 100034
 [36] 100035 100036 100037 100038 100039
100040 100041
 [43] 100042 100043 100044 100045 100046
100047 100048
 [50] 100049 100050 100051 100052 100053
100054 100055
 [57] 100056 100057 100058 100059 100060
100061 100062
 [64] 100063 100064 100065 100066 100067
100068 100069
 [71] 100070 100071 100072 100073 100074
100075 100076
 [78] 100077 100078 100079 100080 100081
100082 100083
 [85] 100084 100085 100086 100087 100088
100089 100090
 [92] 100091 100092 100093 100094 100095
100096 100097

On Wed, Jan 11, 2012 at 11:32 AM, Petr PIKAL petr.pi...@precheza.cz wrote:
 Hi

 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.

 I would start with

 ?abbreviate
 and check uniqueness with
 ?unique or ?duplicated

 Regards
 Petr



 Regards,
 Ayyappa

    [[alternative HTML version deleted]]

 __
 R-help@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.

 __
 R-help@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.



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

__
R-help@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.


Re: [R] Odp: Generating unque patient IDs

2012-01-11 Thread David Winsemius
Unfortunately the rounding effect (which I assumed was related to  
the automatic conversion from integer to numeric) is only going to  
show up above 2147483647L, so I question whether you really  
demonstrated a solution to what I understood was the fundamental  
problem.


--
David.

On Jan 11, 2012, at 11:50 AM, jim holtman wrote:


Does this do it for you:


sprintf(%010.0f, seq(10.0, length = 250, by = 1.0))

 [1] 10 11 12 13 14
15 16
 [8] 17 18 19 100010 100011
100012 100013
[15] 100014 100015 100016 100017 100018
100019 100020
[22] 100021 100022 100023 100024 100025
100026 100027
[29] 100028 100029 100030 100031 100032
100033 100034
[36] 100035 100036 100037 100038 100039
100040 100041
[43] 100042 100043 100044 100045 100046
100047 100048
[50] 100049 100050 100051 100052 100053
100054 100055
[57] 100056 100057 100058 100059 100060
100061 100062
[64] 100063 100064 100065 100066 100067
100068 100069
[71] 100070 100071 100072 100073 100074
100075 100076
[78] 100077 100078 100079 100080 100081
100082 100083
[85] 100084 100085 100086 100087 100088
100089 100090
[92] 100091 100092 100093 100094 100095
100096 100097

On Wed, Jan 11, 2012 at 11:32 AM, Petr PIKAL  
petr.pi...@precheza.cz wrote:

Hi


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.


I would start with

?abbreviate
and check uniqueness with
?unique or ?duplicated

Regards
Petr




Regards,
Ayyappa

   [[alternative HTML version deleted]]

__
R-help@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.


__
R-help@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.




--
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

__
R-help@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.


David Winsemius, MD
West Hartford, CT

__
R-help@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.


Re: [R] Odp: Generating unque patient IDs

2012-01-11 Thread jim holtman
One of the reasons that I specified the 'seq' command as it was was to
make sure it used numerics:

 x - seq(123456789012.0, length = 10, by = 1.0)
 x
 [1] 123456789012 123456789013 123456789014 123456789015 123456789016
123456789017 123456789018
 [8] 123456789019 123456789020 123456789021
 str(x)
 num [1:10] 123456789012 123456789013 123456789014 123456789015 123456789016 ...


On Wed, Jan 11, 2012 at 12:14 PM, David Winsemius
dwinsem...@comcast.net wrote:
 Unfortunately the rounding effect (which I assumed was related to the
 automatic conversion from integer to numeric) is only going to show up above
 2147483647L, so I question whether you really demonstrated a solution to
 what I understood was the fundamental problem.

 --
 David.

 On Jan 11, 2012, at 11:50 AM, jim holtman wrote:

 Does this do it for you:

 sprintf(%010.0f, seq(10.0, length = 250, by = 1.0))

  [1] 10 11 12 13 14
 15 16
  [8] 17 18 19 100010 100011
 100012 100013
 [15] 100014 100015 100016 100017 100018
 100019 100020
 [22] 100021 100022 100023 100024 100025
 100026 100027
 [29] 100028 100029 100030 100031 100032
 100033 100034
 [36] 100035 100036 100037 100038 100039
 100040 100041
 [43] 100042 100043 100044 100045 100046
 100047 100048
 [50] 100049 100050 100051 100052 100053
 100054 100055
 [57] 100056 100057 100058 100059 100060
 100061 100062
 [64] 100063 100064 100065 100066 100067
 100068 100069
 [71] 100070 100071 100072 100073 100074
 100075 100076
 [78] 100077 100078 100079 100080 100081
 100082 100083
 [85] 100084 100085 100086 100087 100088
 100089 100090
 [92] 100091 100092 100093 100094 100095
 100096 100097

 On Wed, Jan 11, 2012 at 11:32 AM, Petr PIKAL petr.pi...@precheza.cz
 wrote:

 Hi


 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.


 I would start with

 ?abbreviate
 and check uniqueness with
 ?unique or ?duplicated

 Regards
 Petr



 Regards,
 Ayyappa

   [[alternative HTML version deleted]]


 __
 R-help@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.


 __
 R-help@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.




 --
 Jim Holtman
 Data Munger Guru

 What is the problem that you are trying to solve?
 Tell me what you want to do, not how you want to do it.


 __
 R-help@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.


 David Winsemius, MD
 West Hartford, CT




-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

__
R-help@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.


Re: [R] Odp: Generating unque patient IDs

2012-01-11 Thread Ayyappa Chaturvedula

Dear all,
I am sorry if I misstated the problem. The roundig issue is with  
NONMEM software not with R. But the suggestions are helpful.


Regards,Ayyappa Chaturvedula

On Jan 11, 2012, at 12:14 PM, David Winsemius dwinsem...@comcast.net  
wrote:


Unfortunately the rounding effect (which I assumed was related to  
the automatic conversion from integer to numeric) is only going to  
show up above 2147483647L, so I question whether you really  
demonstrated a solution to what I understood was the fundamental  
problem.


--
David.

On Jan 11, 2012, at 11:50 AM, jim holtman wrote:


Does this do it for you:


sprintf(%010.0f, seq(10.0, length = 250, by = 1.0))

[1] 10 11 12 13 14
15 16
[8] 17 18 19 100010 100011
100012 100013
[15] 100014 100015 100016 100017 100018
100019 100020
[22] 100021 100022 100023 100024 100025
100026 100027
[29] 100028 100029 100030 100031 100032
100033 100034
[36] 100035 100036 100037 100038 100039
100040 100041
[43] 100042 100043 100044 100045 100046
100047 100048
[50] 100049 100050 100051 100052 100053
100054 100055
[57] 100056 100057 100058 100059 100060
100061 100062
[64] 100063 100064 100065 100066 100067
100068 100069
[71] 100070 100071 100072 100073 100074
100075 100076
[78] 100077 100078 100079 100080 100081
100082 100083
[85] 100084 100085 100086 100087 100088
100089 100090
[92] 100091 100092 100093 100094 100095
100096 100097

On Wed, Jan 11, 2012 at 11:32 AM, Petr PIKAL  
petr.pi...@precheza.cz wrote:

Hi


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.


I would start with

?abbreviate
and check uniqueness with
?unique or ?duplicated

Regards
Petr




Regards,
Ayyappa

  [[alternative HTML version deleted]]

__
R-help@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.


__
R-help@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.




--
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

__
R-help@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.


David Winsemius, MD
West Hartford, CT



__
R-help@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.