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

Allow vpc to be an s3 method. #94

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mattfidler
Copy link

Addresses Issue #92

@mattfidler
Copy link
Author

Hi @guiastrennec I have fixed the VPC issues. I think you have some problems with the tibbles they have a new type of output based on pillar. I'm not sure what you want to do with these tests.

@mattfidler
Copy link
Author

The first failure is

> sum_term(model, "nonmem")
# A tibble: 1 x 4
  problem subprob label value                                                  
    <dbl>   <dbl> <chr> <chr>                                                  
1    1.00       0 term  "MINIMIZATION TERMINATED\nDUE TO PROXIMITY OF NEXT ITE 
> expected_result
# A tibble: 1 x 4
  problem subprob label value                                                  
    <dbl>   <dbl> <chr> <chr>                                                  
1    1.00       0 term  "MINIMIZATION TERMINATED\nDUE TO PROXIMITY OF NEXT ITE 
> 

The structure is the same too

> str(sum_term(model, "nonmem"))
Classes 'tbl_df', 'tbl' and 'data.frame':	1 obs. of  4 variables:
 $ problem: num 1
 $ subprob: num 0
 $ label  : chr "term"
 $ value  : chr "MINIMIZATION TERMINATED\nDUE TO PROXIMITY OF NEXT ITERATION EST. TO A VALUE\nAT WHICH THE OBJ. FUNC. IS INFINIT"| __truncated__
> str(expected_result)
Classes 'tbl_df', 'tbl' and 'data.frame':	1 obs. of  4 variables:
 $ problem: num 1
 $ subprob: num 0
 $ label  : chr "term"
 $ value  : chr "MINIMIZATION TERMINATED\nDUE TO PROXIMITY OF NEXT ITERATION EST. TO A VALUE\nAT WHICH THE OBJ. FUNC. IS INFINIT"| __truncated__
> 

@mattfidler
Copy link
Author

Note, that running test-xpose_data line by line yeilds no errors. So to me there something has changed in stringr or the like.

@mattfidler
Copy link
Author

To test my hypothesis, I tested your package without any modifications on my system (which has some of the latest packages) and get the same failures:

Here is my output


R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> > if (identical(getOption('pager'), file.path(R.home('bin'), 'pager'))) options(pager='console') # rather take the ESS one 
> options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE)
> devtools::check()
Updating xpose documentation
Loading xpose
Loading required package: ggplot2
Do you like the new xpose? Give us some feedback on github:
https://github.com/UUPharmacometrics/xpose
Writing NAMESPACE
Writing xpdb_ex_pk.Rd
Writing data_opt.Rd
Writing only_obs.Rd
Writing only_distinct.Rd
Writing reorder_factors.Rd
Writing fetch_data.Rd
Writing list_nm_tables.Rd
Writing manual_nm_import.Rd
Writing list_nm_tables_manual.Rd
Writing amt_vs_idv.Rd
Writing distrib_plot.Rd
Writing dv_vs_pred.Rd
Writing ind_plots.Rd
Writing minimization_plots.Rd
Writing qq_plot.Rd
Writing res_vs_pred.Rd
Writing res_vs_idv.Rd
Writing pred_vs_idv.Rd
Writing vpc.Rd
Writing print.xpose_data.Rd
Writing print.xpose_plot.Rd
Writing prm_table.Rd
Writing read_nm_files.Rd
Writing parse_nm_files.Rd
Writing raw_to_tibble.Rd
Writing read_nm_model.Rd
Writing read_nm_tables.Rd
Writing read_funs.Rd
Writing read_args.Rd
Writing combine_tables.Rd
Writing merge_firstonly.Rd
Writing index_table.Rd
Writing summary.xpose_data.Rd
Writing template_titles.Rd
Writing gg_themes.Rd
Writing xp_themes.Rd
Writing transform_prm.Rd
Writing update_themes.Rd
Writing reexports.Rd
Writing is.xp.theme.Rd
Writing is.xpdb.Rd
Writing is.nm.model.Rd
Writing is.nm.table.list.Rd
Writing as.nm.table.list.Rd
Writing is.xpose.plot.Rd
Writing is.formula.Rd
Writing as.ctime.Rd
Writing msg.Rd
Writing file_path.Rd
Writing get_extension.Rd
Writing make_extension.Rd
Writing update_extension.Rd
Writing software.Rd
Writing list_vars.Rd
Writing set_vars.Rd
Writing vpc_data.Rd
Writing vpc_opt.Rd
Writing get_code.Rd
Writing get_data.Rd
Writing get_file.Rd
Writing get_summary.Rd
Writing get_prm.Rd
Writing grab_iter.Rd
Writing get_prm_transformation_formulas.Rd
Writing get_special.Rd
Writing subset_xpdb.Rd
Writing modify_xpdb.Rd
Writing summarize_xpdb.Rd
Writing edit_xpose_data.Rd
Writing xpdb_index_update.Rd
Writing check_quo_vars.Rd
Writing irep.Rd
Writing list_xpdb.Rd
Writing xplot_distrib.Rd
Writing check_problem.Rd
Writing check_xpdb.Rd
Writing check_plot_type.Rd
Writing check_scales.Rd
Writing append_suffix.Rd
Writing parse_title.Rd
Writing filter_xp_theme.Rd
Writing all_data_problem.Rd
Writing last_data_problem.Rd
Writing default_plot_problem.Rd
Writing all_file_problem.Rd
Writing last_file_problem.Rd
Writing last_file_subprob.Rd
Writing last_file_method.Rd
Writing drop_fixed_cols.Rd
Writing xp_var.Rd
Writing aes_c.Rd
Writing aes_filter.Rd
Writing aes_rename.Rd
Writing add_facet_var.Rd
Writing xplot_qq.Rd
Writing xplot_scatter.Rd
Writing xpose-package.Rd
Writing xpose_data.Rd
Writing parse_arg.Rd
Writing update_args.Rd
Writing xp_map.Rd
Writing xp_geoms.Rd
Writing xpose_panels.Rd
Writing xpose_save.Rd
Setting env vars --------------------------------------------------------------
CFLAGS  : -Wall -pedantic
CXXFLAGS: -Wall -pedantic
Building xpose ----------------------------------------------------------------
"c:/Users/fidlema3/AppData/Local/nlmixr/R/bin/x64/R" --no-site-file  \
  --no-environ --no-save --no-restore --quiet CMD build  \
  "c:/SVN/Wenping/xpose" --no-resave-data --no-manual 

* checking for file 'c:/SVN/Wenping/xpose/DESCRIPTION' ... OK
* preparing 'xpose':
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
* building 'xpose_0.4.2.tar.gz'

Setting env vars --------------------------------------------------------------
_R_CHECK_CRAN_INCOMING_USE_ASPELL_: TRUE
_R_CHECK_CRAN_INCOMING_           : FALSE
_R_CHECK_FORCE_SUGGESTS_          : FALSE
Checking xpose ----------------------------------------------------------------
"c:/Users/fidlema3/AppData/Local/nlmixr/R/bin/x64/R" --no-site-file  \
  --no-environ --no-save --no-restore --quiet CMD check  \
  "C:\Users\fidlema3\AppData\Local\Temp\ep\Rtmpu6EfqF/xpose_0.4.2.tar.gz"  \
  --as-cran --timings --no-manual 

* using log directory 'C:/Users/fidlema3/AppData/Local/Temp/ep/Rtmpu6EfqF/xpose.Rcheck'
* using R version 3.4.3 (2017-11-30)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using options '--no-manual --as-cran'
* checking for file 'xpose/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'xpose' version '0.4.2'
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... NOTE
Package suggested but not available for checking: 'webshot'
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package 'xpose' can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of 'data' directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
 WARNING
'qpdf' is needed for checks on size reduction of PDFs
* checking installed files from 'inst/doc' ... OK
* checking files in 'vignettes' ... OK
* checking examples ... OK
Examples with CPU or elapsed time > 5s
          user system elapsed
ind_plots 5.41   0.03    5.47
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
  Running 'testthat.R' [40s]
Warning message:
running command '"c:/Users/fidlema3/AppData/Local/nlmixr/R/bin/x64/R" CMD BATCH --vanilla  "testthat.R" "testthat.Rout"' had status 1 
 ERROR
Running the tests in 'tests/testthat.R' failed.
Last 13 lines of output:
  7: all.equal(target[[i]], current[[i]], check.attributes = check.attributes, use.names = use.names, 
         ...)
  8: all.equal.tbl_df(target[[i]], current[[i]], check.attributes = check.attributes, 
         use.names = use.names, ...)
  9: equal_data_frame(target, current, ignore_col_order = ignore_col_order, ignore_row_order = ignore_row_order, 
         convert = convert)
  
  == testthat results  ===========================================================
  OK: 528 SKIPPED: 0 FAILED: 3
  1. Failure: Termination messages are parsed when minimization is terminated (@test-model-summary.R#121) 
  2. Error: properly creates the xpdb when using the file argument (@test-xpose_data.R#47) 
  3. Error: properly creates the xpdb when using the runno argument (@test-xpose_data.R#64) 
  
  Error: testthat unit tests failed
  Execution halted
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in 'inst/doc' ... OK
* checking re-building of vignette outputs ... OK
* DONE

Status: 1 ERROR, 1 WARNING, 1 NOTE
See
  'C:/Users/fidlema3/AppData/Local/Temp/ep/Rtmpu6EfqF/xpose.Rcheck/00check.log'
for details.

R CMD check results
1 error  | 0 warnings | 1 note 
checking tests ... ERROR
  Running 'testthat.R' [40s]
Running the tests in 'tests/testthat.R' failed.
Last 13 lines of output:
  7: all.equal(target[[i]], current[[i]], check.attributes = check.attributes, use.names = use.names, 
         ...)
  8: all.equal.tbl_df(target[[i]], current[[i]], check.attributes = check.attributes, 
         use.names = use.names, ...)
  9: equal_data_frame(target, current, ignore_col_order = ignore_col_order, ignore_row_order = ignore_row_order, 
         convert = convert)
  
  == testthat results  ===========================================================
  OK: 528 SKIPPED: 0 FAILED: 3
  1. Failure: Termination messages are parsed when minimization is terminated (@test-model-summary.R#121) 
  2. Error: properly creates the xpdb when using the file argument (@test-xpose_data.R#47) 
  3. Error: properly creates the xpdb when using the runno argument (@test-xpose_data.R#64) 
  
  Error: testthat unit tests failed
  Execution halted

checking package dependencies ... NOTE
Package suggested but not available for checking: 'webshot'
> 

@mattfidler
Copy link
Author

My session info

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 15063)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] xpose_0.4.2   ggplot2_2.2.1

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.16     pillar_1.1.0     compiler_3.4.3   plyr_1.8.4      
 [5] bindr_0.1        tools_3.4.3      testthat_2.0.0   digest_0.6.15   
 [9] memoise_1.1.0    tibble_1.4.2     gtable_0.2.0     pkgconfig_2.0.1 
[13] rlang_0.2.0      commonmark_1.4   bindrcpp_0.2     withr_2.1.1     
[17] dplyr_0.7.4      stringr_1.3.0    roxygen2_6.0.1   xml2_1.1.1      
[21] desc_1.1.1       devtools_1.13.4  hms_0.4.0        rprojroot_1.3-2 
[25] grid_3.4.3       glue_1.2.0       R6_2.2.2         tweenr_0.1.5    
[29] purrr_0.2.4      readr_1.1.1      tidyr_0.8.0      udunits2_0.13   
[33] magrittr_1.5     backports_1.1.2  vpc_1.0.2        scales_0.5.0    
[37] MASS_7.3-47      units_0.5-1      assertthat_0.2.0 ggforce_0.1.1   
[41] colorspace_1.3-2 stringi_1.1.7    lazyeval_0.2.1   munsell_0.4.3   
[45] crayon_1.3.4    
> 

@bguiastr
Copy link
Collaborator

Thanks for the PR. I am aware of the issues with the tests, they are the result of a bug introduced in stringr back in December. I reported the issue but it has not yet been fixed (tidyverse/stringr#203).

@mattfidler
Copy link
Author

Let me know if it gets fixed.

For now, since there is really no issue with the xpose package, I am going to include this branch in the nlmixr installer (FYI), unless you have some strong objection to this.

To trigger travis/appveyor
@vrognas
Copy link
Contributor

vrognas commented Sep 30, 2023

The issue in stringr has been fixed in tidyverse/stringr#206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants