Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NCA failed with some data. #1

Open
RamomNF opened this issue Sep 16, 2019 · 10 comments
Open

NCA failed with some data. #1

RamomNF opened this issue Sep 16, 2019 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@RamomNF
Copy link

RamomNF commented Sep 16, 2019

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
Copy link
Member

shanmdphd commented Sep 17, 2019

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

@shanmdphd shanmdphd added the bug Something isn't working label Sep 17, 2019
@shanmdphd shanmdphd self-assigned this Sep 17, 2019
@nskoch
Copy link

nskoch commented Apr 9, 2021

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

@nskoch
Copy link

nskoch commented Apr 9, 2021

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

@shanmdphd
Copy link
Member

@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
Copy link

nskoch commented Apr 10, 2021 via email

@ksbae
Copy link

ksbae commented Apr 10, 2021 via email

@ksbae
Copy link

ksbae commented Apr 10, 2021 via email

@nskoch
Copy link

nskoch commented Apr 11, 2021 via email

@ksbae
Copy link

ksbae commented Apr 11, 2021 via email

@nskoch
Copy link

nskoch commented Apr 11, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants