asancpt / NonCompart-tests

Validation of Noncompartmental Analysis Performed by NonCompart R package https://asancpt.github.io/NonCompart-tests/validation_0.4.4.pdf
2 stars 2 forks source link

NCA failed with some data. #1

Open RamomNF opened 5 years ago

RamomNF commented 5 years ago

Hi,

I've been testing the NonCompart package for some time and I've found some datasets which the package function fails or prints a message somewhat strange.

I'll be reporting one issue at time. So, I've submitted a dataset where I'm not being able to use neither sNCA nor tblNCA.

fail1.xlsx

It just prints the message below and fails

Error in [<-.data.frame(*tmp*, Res[, 2] == 0 | Res[, 2] == Inf, 2, : missing values are not allowed in subscripted assignments of data frames

Thank you.

shanmdphd commented 5 years ago

Thanks for sharing your issue. However, the following codes performed NCA without any errors. We could not reproduce the error you got.

Would you please provide the full script and the output of devtools::session_info() here?

library(readxl)
library(NonCompart)

Data = as.data.frame(read_excel('fail1.xlsx'))
Res = tblNCA(Data, key=c("Subject", "Period", "Formulation"), 
             colTime="Time", colConc="Concentration", 
             dose=150, doseUnit="ug", concUnit="ug/mL", R2ADJ=0)

knitr::kable(head(Res[ , 1:10]))
Subject Period Formulation b0 CMAX CMAXD TMAX TLAG CLST CLSTP
1 2 B -0.5861514 14.723 0.0981533 2.00 1.00 0.064 0.0651636
1 4 B 0.5897648 13.691 0.0912733 2.25 1.50 0.174 0.1740333
1 1 A 1.0589757 20.138 0.1342533 2.50 1.75 0.341 0.1422012
1 3 A 1.3231138 13.898 0.0926533 2.00 1.25 0.241 0.0842974
2 1 B 0.7028187 28.106 0.1873733 2.25 1.50 0.052 0.0599840
2 3 B 0.4132031 23.075 0.1538333 2.25 1.25 0.123 0.1412312

Environment

devtools::session_info()
## - Session info ----------------------------------------------------------
##  setting  value                       
##  version  R version 3.6.1 (2019-07-05)
##  os       Windows 10 x64              
##  system   x86_64, mingw32             
##  ui       RTerm                       
##  language (EN)                        
##  collate  Korean_Korea.949            
##  ctype    Korean_Korea.949            
##  tz       Asia/Seoul                  
##  date     2019-09-17                  
## 
## - Packages --------------------------------------------------------------
##  package     * version date       lib source        
##  assertthat    0.2.1   2019-03-21 [1] CRAN (R 3.6.1)
##  backports     1.1.4   2019-04-10 [1] CRAN (R 3.6.0)
##  callr         3.3.1   2019-07-18 [1] CRAN (R 3.6.1)
##  cellranger    1.1.0   2016-07-27 [1] CRAN (R 3.6.1)
##  cli           1.1.0   2019-03-19 [1] CRAN (R 3.6.1)
##  crayon        1.3.4   2017-09-16 [1] CRAN (R 3.6.1)
##  desc          1.2.0   2018-05-01 [1] CRAN (R 3.6.1)
##  devtools      2.2.0   2019-09-07 [1] CRAN (R 3.6.1)
##  digest        0.6.20  2019-07-04 [1] CRAN (R 3.6.1)
##  DT            0.8     2019-08-07 [1] CRAN (R 3.6.1)
##  ellipsis      0.2.0.1 2019-07-02 [1] CRAN (R 3.6.1)
##  evaluate      0.14    2019-05-28 [1] CRAN (R 3.6.1)
##  fs            1.3.1   2019-05-06 [1] CRAN (R 3.6.1)
##  glue          1.3.1   2019-03-12 [1] CRAN (R 3.6.1)
##  highr         0.8     2019-03-20 [1] CRAN (R 3.6.1)
##  htmltools     0.3.6   2017-04-28 [1] CRAN (R 3.6.1)
##  htmlwidgets   1.3     2018-09-30 [1] CRAN (R 3.6.1)
##  knitr         1.24    2019-08-08 [1] CRAN (R 3.6.1)
##  magrittr      1.5     2014-11-22 [1] CRAN (R 3.6.1)
##  memoise       1.1.0   2017-04-21 [1] CRAN (R 3.6.1)
##  NonCompart  * 0.4.4   2018-07-19 [1] CRAN (R 3.6.0)
##  pillar        1.4.2   2019-06-29 [1] CRAN (R 3.6.1)
##  pkgbuild      1.0.5   2019-08-26 [1] CRAN (R 3.6.1)
##  pkgconfig     2.0.2   2018-08-16 [1] CRAN (R 3.6.1)
##  pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.6.1)
##  prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.6.1)
##  processx      3.4.1   2019-07-18 [1] CRAN (R 3.6.1)
##  ps            1.3.0   2018-12-21 [1] CRAN (R 3.6.1)
##  R6            2.4.0   2019-02-14 [1] CRAN (R 3.6.1)
##  Rcpp          1.0.2   2019-07-25 [1] CRAN (R 3.6.1)
##  readxl      * 1.3.1   2019-03-13 [1] CRAN (R 3.6.1)
##  remotes       2.1.0   2019-06-24 [1] CRAN (R 3.6.1)
##  rlang         0.4.0   2019-06-25 [1] CRAN (R 3.6.1)
##  rmarkdown     1.15    2019-08-21 [1] CRAN (R 3.6.1)
##  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.6.1)
##  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.6.1)
##  stringi       1.4.3   2019-03-12 [1] CRAN (R 3.6.0)
##  stringr       1.4.0   2019-02-10 [1] CRAN (R 3.6.1)
##  testthat      2.2.1   2019-07-25 [1] CRAN (R 3.6.1)
##  tibble        2.1.3   2019-06-06 [1] CRAN (R 3.6.1)
##  usethis       1.5.1   2019-07-04 [1] CRAN (R 3.6.1)
##  withr         2.1.2   2018-03-15 [1] CRAN (R 3.6.1)
##  xfun          0.9     2019-08-21 [1] CRAN (R 3.6.1)
##  yaml          2.2.0   2018-07-25 [1] CRAN (R 3.6.0)
## 
## [1] C:/Users/cmc/Rlib
## [2] C:/Program Files/R/R-3.6.1/library
nskoch commented 3 years ago

I have the same error message. Any idea or what's going on? Best regards Nicolas

nskoch commented 3 years ago

Error in [<-.data.frame(*tmp*, Res[, 2] == 0 | Res[, 2] == Inf, 2, : missing values are not allowed in subscripted assignments of data frames

shanmdphd commented 3 years ago

@nskoch ,

It's mainly due to an input of the key argument. Or you can check if there're duplicates of time and concentration data for a given subject.

It would be nice if you could provide minimal working example (MWE), and I will sort out the problem for you.

Pil

nskoch commented 3 years ago

Hi

I work with simulated data, 2 groups of subjects (n=2x500) with 2 full profiles by subject. When I limit my dataset to 20 pk profiles, it runs bu I have to define the slope manually which is not possible for 1000 subject. My interest is on AUCall, Tmax and Cmax, I do not need slope. Is it possible with the package ?

Best regards Nicolas

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Garanti sans virus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le sam. 10 avr. 2021 à 06:43, Sungpil Han @.***> a écrit :

@nskoch https://github.com/nskoch ,

It's mainly due to an input of the key argument. Or you can check if there're duplicates of time and concentration data for a given subject.

It would be nice if you could provide minimal working example (MWE), and I will sort out the problem for you.

Pil

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817077069, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBGW6HNGDKEDJSCC77TPX3TH7JNRANCNFSM4IXCTT7Q .

-- Pharmacology & Pharmacokinetic Consultant Professor of Medicine, University of Aix-Marseille Head of the Department of Clinical Pharmacology, Ste Marguerite Hospital Office: +33 49 106 5874 Mobile: +33 63 339 1765

ksbae commented 3 years ago

Use R2ADJ=0 option

나의 iPhone에서 보냄

      1. 23:57, Simon @.***> 작성:

 Hi

I work with simulated data, 2 groups of subjects (n=2x500) with 2 full profiles by subject. When I limit my dataset to 20 pk profiles, it runs bu I have to define the slope manually which is not possible for 1000 subject. My interest is on AUCall, Tmax and Cmax, I do not need slope. Is it possible with the package ?

Best regards Nicolas

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Garanti sans virus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le sam. 10 avr. 2021 à 06:43, Sungpil Han @.***> a écrit :

@nskoch https://github.com/nskoch ,

It's mainly due to an input of the key argument. Or you can check if there're duplicates of time and concentration data for a given subject.

It would be nice if you could provide minimal working example (MWE), and I will sort out the problem for you.

Pil

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817077069, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBGW6HNGDKEDJSCC77TPX3TH7JNRANCNFSM4IXCTT7Q .

-- Pharmacology & Pharmacokinetic Consultant Professor of Medicine, University of Aix-Marseille Head of the Department of Clinical Pharmacology, Ste Marguerite Hospital Office: +33 49 106 5874 Mobile: +33 63 339 1765 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ksbae commented 3 years ago

나의 iPhone에서 보냄

      1. 06:57, Bae Kyun-Seop @.***> 작성:

 Use R2ADJ=0 option

나의 iPhone에서 보냄

      1. 23:57, Simon @.***> 작성:



Hi

I work with simulated data, 2 groups of subjects (n=2x500) with 2 full profiles by subject. When I limit my dataset to 20 pk profiles, it runs bu I have to define the slope manually which is not possible for 1000 subject. My interest is on AUCall, Tmax and Cmax, I do not need slope. Is it possible with the package ?

Best regards Nicolas

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Garanti sans virus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le sam. 10 avr. 2021 à 06:43, Sungpil Han @.***> a écrit :

@nskoch https://github.com/nskoch ,

It's mainly due to an input of the key argument. Or you can check if there're duplicates of time and concentration data for a given subject.

It would be nice if you could provide minimal working example (MWE), and I will sort out the problem for you.

Pil

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817077069, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBGW6HNGDKEDJSCC77TPX3TH7JNRANCNFSM4IXCTT7Q .

-- Pharmacology & Pharmacokinetic Consultant Professor of Medicine, University of Aix-Marseille Head of the Department of Clinical Pharmacology, Ste Marguerite Hospital Office: +33 49 106 5874 Mobile: +33 63 339 1765

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817149249, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACKQA4RCXC6RDVS4RYCAQ3TTIBROHANCNFSM4IXCTT7Q.

nskoch commented 3 years ago

Hi

many thanks, it works fine.

My two groups received different dose, is it possible to take it into account? In the examples, only one dose value is given.

Further each subject has 2 profiles, is it possible to compute PK parameters for each profile? I have created 2 ID for each subject (one for each profile) but that's not elegant.

Best regards Nicolas

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Garanti sans virus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le dim. 11 avr. 2021 à 00:24, Kyun-Seop Bae @.***> a écrit :

나의 iPhone에서 보냄

      1. 06:57, Bae Kyun-Seop @.***> 작성:

 Use R2ADJ=0 option

나의 iPhone에서 보냄

      1. 23:57, Simon @.***> 작성:



Hi

I work with simulated data, 2 groups of subjects (n=2x500) with 2 full profiles by subject. When I limit my dataset to 20 pk profiles, it runs bu I have to define the slope manually which is not possible for 1000 subject. My interest is on AUCall, Tmax and Cmax, I do not need slope. Is it possible with the package ?

Best regards Nicolas

< https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Garanti sans virus. www.avast.com < https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le sam. 10 avr. 2021 à 06:43, Sungpil Han @.***> a écrit :

@nskoch https://github.com/nskoch ,

It's mainly due to an input of the key argument. Or you can check if there're duplicates of time and concentration data for a given subject.

It would be nice if you could provide minimal working example (MWE), and I will sort out the problem for you.

Pil

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817077069>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKBGW6HNGDKEDJSCC77TPX3TH7JNRANCNFSM4IXCTT7Q>

.

-- Pharmacology & Pharmacokinetic Consultant Professor of Medicine, University of Aix-Marseille Head of the Department of Clinical Pharmacology, Ste Marguerite Hospital Office: +33 49 106 5874 Mobile: +33 63 339 1765

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub< https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817149249>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/ACKQA4RCXC6RDVS4RYCAQ3TTIBROHANCNFSM4IXCTT7Q>.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817210310, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBGW6G3MTGSREMCMA2QARTTIDF3JANCNFSM4IXCTT7Q .

-- Pharmacology & Pharmacokinetic Consultant Professor of Medicine, University of Aix-Marseille Head of the Department of Clinical Pharmacology, Ste Marguerite Hospital Office: +33 49 106 5874 Mobile: +33 63 339 1765

ksbae commented 3 years ago

The necessary option is similar to the following;

...( , key=c(“ID”, “Period”), ...)

      1. 18:03, Simon @.***> 작성:



Hi

many thanks, it works fine.

My two groups received different dose, is it possible to take it into account? In the examples, only one dose value is given.

Further each subject has 2 profiles, is it possible to compute PK parameters for each profile? I have created 2 ID for each subject (one for each profile) but that's not elegant.

Best regards Nicolas

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Garanti sans virus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le dim. 11 avr. 2021 à 00:24, Kyun-Seop Bae @.***> a écrit :

나의 iPhone에서 보냄

      1. 06:57, Bae Kyun-Seop @.***> 작성:

 Use R2ADJ=0 option

나의 iPhone에서 보냄

      1. 23:57, Simon @.***> 작성:



Hi

I work with simulated data, 2 groups of subjects (n=2x500) with 2 full profiles by subject. When I limit my dataset to 20 pk profiles, it runs bu I have to define the slope manually which is not possible for 1000 subject. My interest is on AUCall, Tmax and Cmax, I do not need slope. Is it possible with the package ?

Best regards Nicolas

< https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Garanti sans virus. www.avast.com < https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le sam. 10 avr. 2021 à 06:43, Sungpil Han @.***> a écrit :

@nskoch https://github.com/nskoch ,

It's mainly due to an input of the key argument. Or you can check if there're duplicates of time and concentration data for a given subject.

It would be nice if you could provide minimal working example (MWE), and I will sort out the problem for you.

Pil

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817077069>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKBGW6HNGDKEDJSCC77TPX3TH7JNRANCNFSM4IXCTT7Q>

.

-- Pharmacology & Pharmacokinetic Consultant Professor of Medicine, University of Aix-Marseille Head of the Department of Clinical Pharmacology, Ste Marguerite Hospital Office: +33 49 106 5874 Mobile: +33 63 339 1765

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub< https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817149249>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/ACKQA4RCXC6RDVS4RYCAQ3TTIBROHANCNFSM4IXCTT7Q>.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817210310, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBGW6G3MTGSREMCMA2QARTTIDF3JANCNFSM4IXCTT7Q .

-- Pharmacology & Pharmacokinetic Consultant Professor of Medicine, University of Aix-Marseille Head of the Department of Clinical Pharmacology, Ste Marguerite Hospital Office: +33 49 106 5874 Mobile: +33 63 339 1765

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817274427, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACKQA4UQSHGK2Y3IOGR7Z23TIFQW3ANCNFSM4IXCTT7Q.

nskoch commented 3 years ago

Many thanks That’s fine Nicolas

Le 11 avr. 2021 à 11:43, Kyun-Seop Bae @.***> a écrit :



The necessary option is similar to the following;

...( , key=c(“ID”, “Period”), ...)

      1. 18:03, Simon @.***> 작성:



Hi

many thanks, it works fine.

My two groups received different dose, is it possible to take it into account? In the examples, only one dose value is given.

Further each subject has 2 profiles, is it possible to compute PK parameters for each profile? I have created 2 ID for each subject (one for each profile) but that's not elegant.

Best regards Nicolas

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Garanti sans virus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le dim. 11 avr. 2021 à 00:24, Kyun-Seop Bae @.***> a écrit :

나의 iPhone에서 보냄

      1. 06:57, Bae Kyun-Seop @.***> 작성:

 Use R2ADJ=0 option

나의 iPhone에서 보냄

      1. 23:57, Simon @.***> 작성:



Hi

I work with simulated data, 2 groups of subjects (n=2x500) with 2 full profiles by subject. When I limit my dataset to 20 pk profiles, it runs bu I have to define the slope manually which is not possible for 1000 subject. My interest is on AUCall, Tmax and Cmax, I do not need slope. Is it possible with the package ?

Best regards Nicolas

< https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

Garanti sans virus. www.avast.com < https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le sam. 10 avr. 2021 à 06:43, Sungpil Han @.***> a écrit :

@nskoch https://github.com/nskoch ,

It's mainly due to an input of the key argument. Or you can check if there're duplicates of time and concentration data for a given subject.

It would be nice if you could provide minimal working example (MWE), and I will sort out the problem for you.

Pil

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817077069>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKBGW6HNGDKEDJSCC77TPX3TH7JNRANCNFSM4IXCTT7Q>

.

-- Pharmacology & Pharmacokinetic Consultant Professor of Medicine, University of Aix-Marseille Head of the Department of Clinical Pharmacology, Ste Marguerite Hospital Office: +33 49 106 5874 Mobile: +33 63 339 1765

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub< https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817149249>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/ACKQA4RCXC6RDVS4RYCAQ3TTIBROHANCNFSM4IXCTT7Q>.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817210310, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBGW6G3MTGSREMCMA2QARTTIDF3JANCNFSM4IXCTT7Q .

-- Pharmacology & Pharmacokinetic Consultant Professor of Medicine, University of Aix-Marseille Head of the Department of Clinical Pharmacology, Ste Marguerite Hospital Office: +33 49 106 5874 Mobile: +33 63 339 1765

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/asancpt/NonCompart-tests/issues/1#issuecomment-817274427, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACKQA4UQSHGK2Y3IOGR7Z23TIFQW3ANCNFSM4IXCTT7Q. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.