├── .Rbuildignore ├── .github ├── .gitignore ├── ISSUE_TEMPLATE │ └── bug-and-enhancement-ticket.md └── workflows │ ├── R-CMD-check.yaml │ └── test-coverage.yaml ├── .gitignore ├── .travis.yml ├── CRAN-SUBMISSION ├── DESCRIPTION ├── NAMESPACE ├── NEWS.md ├── R ├── .gitignore ├── assertions.R ├── classInt.R ├── config.R ├── generics.R ├── ggPMX-options.R ├── ggPMX-package.R ├── ggforce-facet-paginate.R ├── gpar.R ├── nlmixr.R ├── nonmem_reader.R ├── param_table.R ├── plot-base.R ├── plot-density.R ├── plot-distribution.R ├── plot-eta-cov.R ├── plot-eta-pairs.R ├── plot-individual.R ├── plot-qq.R ├── plot-residual.R ├── plot-themes.R ├── plot-vpc.R ├── pmx-add-plot.R ├── pmx-all-compute.R ├── pmx-all-plots.R ├── pmx-data.R ├── pmx-filter.R ├── pmx-plots-density.R ├── pmx-plots-distibution.R ├── pmx-plots-eta-cov.R ├── pmx-plots-individual.R ├── pmx-plots-matrix.R ├── pmx-plots-quantile.R ├── pmx-plots-scatter.R ├── pmx-plots-vpc.R ├── pmx-post_load.R ├── pmx-reader.R ├── pmx-report.R ├── pmxClass.R ├── pmx_list_nm_tables.R ├── pmx_manual_import.R ├── pmx_read_nm_files.R ├── pmx_read_nm_model.R ├── pmx_read_nm_tables.R ├── pmx_utils_nonmem_reader.R ├── read_extfile.R ├── utils.R └── zzz.R ├── README.Rmd ├── README.md ├── cran-comments.md ├── ggPMX.Rproj ├── inst ├── examples │ ├── controller.R │ ├── custom_inputs.yaml │ ├── distribution.R │ ├── endpoint.R │ ├── eta_cov.R │ ├── eta_matrix.R │ ├── ggpmx_nlmixr.R │ ├── individual.R │ ├── plots.yaml │ ├── pmx-settings.R │ ├── pmx_config.R │ ├── pmx_nm.R │ ├── pmx_report.R │ ├── qq.R │ ├── residual.R │ ├── templates │ │ ├── custom_report.Rmd │ │ └── misc.Rmd │ ├── uc_review.Rmd │ └── vpc.R ├── extra │ └── run-oq.R ├── init │ ├── abbrev.yaml │ ├── cwres.ppmx │ ├── defaults.yaml │ ├── gpar.yaml │ ├── npd.ppmx │ └── standing.ppmx ├── rmarkdown │ └── templates │ │ ├── individual │ │ ├── skeleton │ │ │ └── skeleton.Rmd │ │ └── template.yaml │ │ └── standing │ │ ├── skeleton │ │ └── skeleton.Rmd │ │ └── template.yaml ├── templates │ ├── mlx │ │ └── standing.ipmx │ └── mlx18 │ │ ├── standing.ipmx │ │ └── standing_old.ipmx └── testdata │ ├── 1_popPK_model │ ├── PKdata_ggPMX.csv │ ├── RESULTS │ │ ├── estimates.txt │ │ ├── finegrid.txt │ │ ├── fulltimes.txt │ │ ├── indiv_eta.txt │ │ ├── indiv_parameters.txt │ │ ├── pop_parameters.txt │ │ └── predictions.txt │ └── project.mlxtran │ ├── extdata │ ├── catab001.csv │ ├── cotab001 │ ├── custom_name.lst │ ├── custom_sim.lst │ ├── for_testing │ │ ├── predictions.csv │ │ └── sim.csv │ ├── mx19_2.csv │ ├── patab001 │ ├── run001.coi │ ├── run001.cor │ ├── run001.cov │ ├── run001.ext │ ├── run001.grd │ ├── run001.lst │ ├── run001.mod │ ├── run001.phi │ ├── run001.shk │ ├── sdtab001 │ ├── sdtab002 │ └── simtab001.zip │ ├── pk_pd │ ├── RESULTS │ │ ├── estimates.txt │ │ ├── finegrid1.txt │ │ ├── finegrid2.txt │ │ ├── indiv_eta.txt │ │ ├── indiv_parameters.txt │ │ ├── pop_parameters.txt │ │ ├── predictions1.txt │ │ └── predictions2.txt │ ├── pk_pd.csv │ └── pk_pd.mlxtran │ └── theophylline │ ├── Monolix │ ├── estimates.txt │ ├── finegrid.txt │ ├── indiv_eta.txt │ ├── pop_parameters.txt │ └── predictions.txt │ ├── data_pk.csv │ └── sim.csv ├── man ├── abbrev.Rd ├── add_draft.Rd ├── check_shrink.Rd ├── distrib.Rd ├── eta_cov.Rd ├── eta_cov_plot.Rd ├── eta_distribution_plot.Rd ├── eta_pairs.Rd ├── eval_sym_parent_env.Rd ├── figures │ ├── README-example-1.png │ ├── README-illustrate_diagnostic-1.png │ ├── README-illustrate_diagnostic-2.png │ ├── README-illustrate_diagnostic-3.png │ ├── README-illustrate_diagnostic-4.png │ ├── README-illustrate_diagnostic-5.png │ ├── README-settings_cat_labels-1.png │ ├── README-settings_cat_labels2-1.png │ ├── README-settings_cat_labels3-1.png │ ├── README-settings_color_scales_local-1.png │ ├── README-settings_solor_scales-1.png │ ├── README-settings_solor_scales_a-1.png │ ├── README-settings_use.abbrev-1.png │ ├── README-settings_use.finegrid-1.png │ ├── README-shrink_plot_box-1.png │ ├── README-shrink_plot_hist-1.png │ ├── README-shrink_plot_no-1.png │ ├── README-shrink_plot_strat-1.png │ ├── README-shrink_plot_var-1.png │ ├── README-unnamed-chunk-14-1.png │ ├── README-unnamed-chunk-16-1.png │ ├── README-unnamed-chunk-17-1.png │ ├── README-unnamed-chunk-18-1.png │ ├── README-unnamed-chunk-19-1.png │ ├── README-unnamed-chunk-20-1.png │ ├── README-unnamed-chunk-26-1.png │ ├── README-unnamed-chunk-27-1.png │ ├── README-unnamed-chunk-28-1.png │ ├── README-unnamed-chunk-29-1.png │ ├── README-unnamed-chunk-30-1.png │ ├── README-unnamed-chunk-31-1.png │ ├── README-unnamed-chunk-41-1.png │ ├── README-unnamed-chunk-45-1.png │ ├── ggPMX_arch.png │ ├── ggPMX_cheat_sheet_0_9_4.png │ ├── ggpmx_example1.png │ └── logo.jpg ├── getPmxOption.Rd ├── get_abbrev.Rd ├── get_cats.Rd ├── get_conts.Rd ├── get_covariates.Rd ├── get_data.Rd ├── get_occ.Rd ├── get_plot.Rd ├── get_plot_config.Rd ├── get_strats.Rd ├── ggPMX.Rd ├── gtable_remove_grobs.Rd ├── individual.Rd ├── input_finegrid.Rd ├── is.pmx_gpar.Rd ├── l_left_join.Rd ├── load_config.Rd ├── load_data_set.Rd ├── load_source.Rd ├── n_pages.Rd ├── param_table.Rd ├── parse_mlxtran.Rd ├── pk_occ.Rd ├── pk_pd.Rd ├── plot_names.Rd ├── plot_pmx.Rd ├── plot_pmx.distrib.Rd ├── plot_pmx.eta_cov.Rd ├── plot_pmx.eta_pairs.Rd ├── plot_pmx.individual.Rd ├── plot_pmx.pmx_dens.Rd ├── plot_pmx.pmx_gpar.Rd ├── plot_pmx.pmx_qq.Rd ├── plot_pmx.residual.Rd ├── plot_shrink.Rd ├── plots.Rd ├── pmx.Rd ├── pmxOptions.Rd ├── pmx_bloq.Rd ├── pmx_combine_tables.Rd ├── pmx_comp_shrink.Rd ├── pmx_config.Rd ├── pmx_copy.Rd ├── pmx_cov.Rd ├── pmx_dens.Rd ├── pmx_endpoint.Rd ├── pmx_file_path.Rd ├── pmx_filter.Rd ├── pmx_get_configs.Rd ├── pmx_get_extension.Rd ├── pmx_gpar.Rd ├── pmx_index_table.Rd ├── pmx_is.nm.table.list.Rd ├── pmx_list_nm_tables.Rd ├── pmx_list_nm_tables_manual.Rd ├── pmx_make_extension.Rd ├── pmx_manual_nm_import.Rd ├── pmx_merge_firstonly.Rd ├── pmx_msg.Rd ├── pmx_nlmixr.Rd ├── pmx_nm.Rd ├── pmx_parse_nm_files.Rd ├── pmx_plot.Rd ├── pmx_plot_cats.Rd ├── pmx_plot_eta_matrix.Rd ├── pmx_plot_individual.Rd ├── pmx_plot_iwres_dens.Rd ├── pmx_plot_vpc.Rd ├── pmx_qq.Rd ├── pmx_qq_plot.Rd ├── pmx_raw_to_tibble.Rd ├── pmx_read_args.Rd ├── pmx_read_funs.Rd ├── pmx_read_nm_files.Rd ├── pmx_read_nm_model.Rd ├── pmx_read_nm_tables.Rd ├── pmx_register_plot.Rd ├── pmx_report.Rd ├── pmx_report_template.Rd ├── pmx_settings.Rd ├── pmx_shrink.Rd ├── pmx_sim.Rd ├── pmx_theme.Rd ├── pmx_tidyr_new_interface.Rd ├── pmx_update.Rd ├── pmx_update_extension.Rd ├── pmx_vpc.Rd ├── pmx_vpc_bin.Rd ├── pmx_vpc_ci.Rd ├── pmx_vpc_obs.Rd ├── pmx_vpc_pi.Rd ├── pmx_vpc_rug.Rd ├── print.abbreviation.Rd ├── print.configs.Rd ├── print.pmxClass.Rd ├── print.pmxConfig.Rd ├── print.pmx_gpar.Rd ├── read_extfile.Rd ├── read_input.Rd ├── read_mlx_ind_est.Rd ├── read_mlx_par_est.Rd ├── read_mlx_pred.Rd ├── reexports.Rd ├── residual.Rd ├── residual_scatter.Rd ├── set_abbrev.Rd ├── set_data.Rd ├── set_plot.Rd ├── sub-.pmx_gpar.Rd ├── theophylline.Rd └── wrap_formula.Rd ├── tests ├── testthat.R └── testthat │ ├── helper-pmxClass.R │ ├── helper-reader.R │ ├── helper-skip.R │ ├── helper-update_plots.R │ ├── test-2023table.R │ ├── test-assertions.R │ ├── test-classInt.R │ ├── test-config.R │ ├── test-ggforce-facet-paginate.R │ ├── test-gpar.R │ ├── test-nlmixr.R │ ├── test-nonmem_reader.R │ ├── test-param_table.R │ ├── test-plot-base.R │ ├── test-plot-defaults.R │ ├── test-plot-density.R │ ├── test-plot-distribution.R │ ├── test-plot-eta-pairs.R │ ├── test-plot-individual.R │ ├── test-plot-residual.R │ ├── test-plot.R │ ├── test-pmx-all-compute.R │ ├── test-pmx-all-plots.R │ ├── test-pmx-plot-eta-cov.R │ ├── test-pmx-plot-vpc.R │ ├── test-pmx-plots-distribution.R │ ├── test-pmx-plots-scatter.R │ ├── test-pmx-post_load.R │ ├── test-pmx-report.R │ ├── test-pmx-vpc-bin.R │ ├── test-pmxClass.R │ ├── test-pmx_filter.R │ ├── test-pmx_list_nm_tables.R │ ├── test-pmx_manual_import.R │ ├── test-pmx_nlmixr.R │ ├── test-pmx_options.R │ ├── test-pmx_read_nm_files.R │ ├── test-pmx_update.R │ ├── test-reader.R │ ├── test-shrinkage.R │ ├── test-utils.R │ ├── test-vdiff.R │ └── warfarin_PD_project.zip └── vignettes ├── .install_extras ├── bloq.Rmd ├── ggPMX-guide.Rmd ├── ggPMX-nlmixr.Rmd └── ggPMX_arch.png /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^data-raw$ 4 | ^tools$ 5 | ^README.rmd$ 6 | ^packrat/ 7 | ^\.Rprofile$ 8 | ^\.travis\.yml$ 9 | ^codecov\.yml$ 10 | ^ggPMX\ Logo\.jpg$ 11 | ^ggPMX-Workshop_Wide_HandsOnPAGE2019.pptx$ 12 | ^ggPMX-Workshop_Wide_PAGE2019.pptx$ 13 | ^ggPMX-guide_2019-04-25.pdf$ 14 | ^ggPMX_Plot_Example1.jpg$ 15 | ^ggPMX_cheat_sheet_0_9_4.png$ 16 | ^ggPMX_cheat_sheet_0_9_4.pptx$ 17 | ^vignettes/ggPMX-nlmixr.Rmd$ 18 | ^vignettes/bloq.Rmd$ 19 | ^man/figures/*.png$ 20 | ^.github/* 21 | ^\.github$ 22 | ^cran-comments\.md$ 23 | ^CRAN-SUBMISSION$ 24 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-and-enhancement-ticket.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug and enhancement ticket 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: baltcir1, biethbr1 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Complete standalone code to reproduce the behavior, including dummy datasets. Please copy-paste the controller creation code. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Screenshots** 20 | If applicable, add screenshots to help explain your problem. 21 | 22 | **Package and platform (please complete the following information):** 23 | - Operating system: [e.g. Linux, Windows] 24 | - ggplot2 version 25 | - ggPMX version [e.g. 1.0] 26 | 27 | **Additional context** 28 | Add any other context about the problem here. 29 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: R-CMD-check 10 | 11 | jobs: 12 | R-CMD-check: 13 | runs-on: ${{ matrix.config.os }} 14 | 15 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) 16 | 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | config: 21 | - {os: macos-latest, r: 'release'} 22 | - {os: windows-latest, r: 'release'} 23 | - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} 24 | - {os: ubuntu-latest, r: 'release'} 25 | 26 | env: 27 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true 28 | RSPM: ${{ matrix.config.rspm }} 29 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 30 | _R_CHECK_FORCE_SUGGESTS_: false 31 | 32 | steps: 33 | - name: Install deps on MacOS 34 | if: runner.os == 'macOS' 35 | run: | 36 | brew install --cask xquartz 37 | brew install cairo 38 | brew install udunits 39 | shell: bash 40 | 41 | - uses: actions/checkout@v3 42 | - uses: r-lib/actions/setup-tinytex@v2 43 | - uses: r-lib/actions/setup-pandoc@v2 44 | 45 | - uses: r-lib/actions/setup-r@v2 46 | with: 47 | r-version: ${{ matrix.config.r }} 48 | http-user-agent: ${{ matrix.config.http-user-agent }} 49 | use-public-rspm: true 50 | 51 | - uses: r-lib/actions/setup-r-dependencies@v2 52 | with: 53 | pak-version: devel 54 | extra-packages: | 55 | any::rcmdcheck 56 | nlmixr2/lotri 57 | nlmixr2/rxode2ll 58 | nlmixr2/rxode2parse 59 | nlmixr2/rxode2random 60 | nlmixr2/rxode2et 61 | nlmixr2/rxode2 62 | nlmixr2/nlmixr2est 63 | nlmixr2/nlmixr2extra 64 | nlmixr2/nlmixr2plot 65 | nlmixr2/nlmixr2 66 | lixoftConnectors=?ignore 67 | needs: check 68 | 69 | - run: tlmgr --version 70 | 71 | - uses: r-lib/actions/check-r-package@v2 72 | with: 73 | build_args: 'c("--no-manual", "--compact-vignettes=gs+qpdf")' 74 | upload-snapshots: true 75 | -------------------------------------------------------------------------------- /.github/workflows/test-coverage.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | 9 | name: test-coverage 10 | 11 | jobs: 12 | test-coverage: 13 | runs-on: ubuntu-latest 14 | env: 15 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 16 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true 17 | _R_CHECK_FORCE_SUGGESTS_: false 18 | 19 | steps: 20 | - uses: actions/checkout@v3 21 | 22 | - uses: r-lib/actions/setup-r@v2 23 | with: 24 | use-public-rspm: true 25 | 26 | - uses: r-lib/actions/setup-r-dependencies@v2 27 | with: 28 | pak-version: devel 29 | extra-packages: | 30 | any::covr 31 | nlmixr2/lotri 32 | nlmixr2/rxode2ll 33 | nlmixr2/rxode2parse 34 | nlmixr2/rxode2random 35 | nlmixr2/rxode2et 36 | nlmixr2/rxode2 37 | lixoftConnectors=?ignore 38 | needs: coverage 39 | 40 | - uses: r-lib/actions/setup-tinytex@v2 41 | 42 | - name: Test coverage 43 | run: | 44 | covr::codecov( 45 | quiet = FALSE, 46 | clean = FALSE, 47 | install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") 48 | ) 49 | shell: Rscript {0} 50 | 51 | - name: Show testthat output 52 | if: always() 53 | run: | 54 | ## -------------------------------------------------------------------- 55 | find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true 56 | shell: bash 57 | 58 | - name: Upload test results 59 | if: failure() 60 | uses: actions/upload-artifact@v3 61 | with: 62 | name: coverage-test-failures 63 | path: ${{ runner.temp }}/package 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | *.Rproj 6 | ggPMX_testPK 7 | packrat/lib*/ 8 | packrat/ 9 | cleanup 10 | NAMESPACE 11 | cont.sh 12 | .Rbuildignore 13 | inst/doc 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # R for travis: see documentation at https://docs.travis-ci.com/user/languages/r 2 | 3 | language: R 4 | sudo: required 5 | cache: packages 6 | warnings_are_errors: false 7 | 8 | r: 9 | - 3.5 10 | - 3.6 11 | - 4.0 12 | - devel 13 | 14 | r_packages: 15 | - covr 16 | - devtools 17 | 18 | addons: 19 | apt: 20 | packages: 21 | - libudunits2-dev 22 | 23 | env: 24 | token: 6e04c811-b9e9-4846-9696-20cf5c215826 25 | global: 26 | - _R_CHECK_FORCE_SUGGESTS_: FALSE 27 | 28 | after_success: 29 | - Rscript -e 'covr::codecov()' 30 | -------------------------------------------------------------------------------- /CRAN-SUBMISSION: -------------------------------------------------------------------------------- 1 | Version: 1.2.11 2 | Date: 2023-11-30 14:42:59 UTC 3 | SHA: 5f9a425bf12c083bfc798b60dbe2a93d46a66628 4 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # ggPMX (development version) 2 | 3 | # ggPMX 1.2.11 4 | 5 | * Fix bug so that reading monolix works on R devel (as requested by CRAN) 6 | 7 | * Change defaults so that scientific notation is not enabled by default 8 | and title is also not added by default 9 | 10 | * Monolix 2023 can now be read by ggPMX 11 | 12 | # ggPMX 1.2.10 13 | 14 | * Skip draft parameter template creation test on CRAN, on some systems 15 | it doesn't seem to work correctly. 16 | 17 | # ggPMX 1.2.9 18 | 19 | * Fix custom template so it works again 20 | 21 | * Fix `nlmixr2`controller to correctly handle blq data 22 | 23 | # ggPMX 1.2.8 24 | 25 | * Always ensure the `isoberv` is "accepted" for input dataset (fixes #235) 26 | 27 | * Copy the testing information in inst to a temporary directory for utils testing 28 | 29 | # ggPMX 1.2.7 30 | 31 | * Added ability to generate ChartData if lixoftConnectors is present 32 | 33 | * Added `nlmixr2` support 34 | 35 | * Added cwres family of plots for `nlmixr`/`nlmixr2` models 36 | 37 | * Added `npd` family of plots for `nlmixr`/`nlmixr2` 38 | 39 | * Added a `NEWS.md` file to track changes to the package. 40 | -------------------------------------------------------------------------------- /R/.gitignore: -------------------------------------------------------------------------------- 1 | mlx_uc.R 2 | -------------------------------------------------------------------------------- /R/generics.R: -------------------------------------------------------------------------------- 1 | #' This is a generic plot method that produces all plots by default described in pmx model 2 | #' evaluation guidance. 3 | #' 4 | #' @param x object to plot 5 | #' @param dx data.table , plot source data 6 | #' @param ... extra argument (not used) 7 | #' @seealso \code{\link{pmx_gpar}}. 8 | #' @family plot_pmx 9 | #' @export 10 | plot_pmx <- function(x, dx, ...) UseMethod("plot_pmx") 11 | -------------------------------------------------------------------------------- /R/ggPMX-options.R: -------------------------------------------------------------------------------- 1 | # This allows user to define package globals , options 2 | .globals <- new.env(parent = emptyenv()) 3 | 4 | .globals$options <- list() 5 | 6 | # Aesthetic aliases 7 | .globals$ggplot <- c( 8 | "col" = "colour", 9 | "color" = "colour", 10 | "pch" = "shape", 11 | "cex" = "size", 12 | "lty" = "linetype", 13 | "lwd" = "size", 14 | "srt" = "angle", 15 | "adj" = "hjust", 16 | "bg" = "fill", 17 | "fg" = "colour", 18 | "min" = "ymin", 19 | "max" = "ymax" 20 | ) 21 | 22 | #' Get ggPMX Option 23 | #' 24 | #' @param name Name of an option to get. 25 | #' @param default Value to be returned if the option is not currently set. 26 | #' 27 | #' @examples 28 | #' \dontrun{ 29 | #' pmxOptions(myOption = 10) 30 | #' getPmxOption("myOption") 31 | #' } 32 | #' @export 33 | getPmxOption <- function(name, default = NULL) { 34 | assert_that(is_string(name)) 35 | 36 | if (name %in% names(.globals$options)) { 37 | .globals$options[[name]] 38 | } else { 39 | default 40 | } 41 | } 42 | 43 | 44 | 45 | #' This function can be used to set ggPMX options 46 | #' 47 | #' \code{getPmxOption} retrieves the value of a ggPMX option. 48 | #' \code{ggPMXOptions} sets the value of ggPMX options; it can also be used to 49 | #' return a list of all currently-set ggPMX options. 50 | #' 51 | #' 52 | #' @param ... Options to set, with the form \code{name = value}. 53 | #' 54 | #' @details 55 | #' There is a global option set, which is available by default. 56 | #' @section Options used in ggPMX: 57 | #' 58 | #' \itemize{ 59 | #' \item \strong{template_dir:} path to template directory 60 | #' } 61 | #' 62 | #' @examples 63 | #' \dontrun{ 64 | #' pmxOptions(template_dir = PATH_TO_CUSTOM_CONFIGURATION) 65 | #' } 66 | #' @export 67 | pmxOptions <- function(...) { 68 | newOpts <- list(...) 69 | if (length(newOpts) > 0) { 70 | if ("template_dir" %in% names(newOpts)) { 71 | .globals$options <- newOpts 72 | } else { 73 | .globals$options <- .globals$options["template_dir"] 74 | } 75 | 76 | .globals$options <- dropNulls.(mergeVectors.(.globals$options, newOpts)) 77 | invisible(.globals$options) 78 | } else { 79 | .globals$options 80 | } 81 | } 82 | 83 | 84 | checkPmxOption <- function(value, pmxname, default = NULL) { 85 | call <- match.call() 86 | if (missing(value)) { 87 | value <- getPmxOption(pmxname, default) 88 | } 89 | if (is.null(value)) { 90 | stop( 91 | sprintf( 92 | "Please set a %s argument or set global %s option", 93 | deparse(call$value), pmxname 94 | ) 95 | ) 96 | } 97 | value 98 | } 99 | -------------------------------------------------------------------------------- /R/ggPMX-package.R: -------------------------------------------------------------------------------- 1 | #' ggPMX: A ggplot2 toolbox for Nonlinear Mixed-Effect Model graphical 2 | #' 3 | #' This package aims to generate diagnostic plots in a standard way. The tool reads data 4 | #' from many sources (MONOLIX,NONMEM,others) and generates standard grahics 5 | #' that can be easily integrated in a single report. 6 | #' 7 | #' \itemize{ 8 | #' \item Get data from different system and create a data source 9 | #' \item Plot many plots using the generic plot method \code{\link{plot_pmx}}. 10 | #' } 11 | #' 12 | #' For support, feedback or bug reports, please reach out to 13 | #' \email{ggPMX_ORG@@dl.mgd.novartis.com}. 14 | #' 15 | #' @section Version History: 16 | #' 17 | #' \describe{ 18 | #' 19 | #' \item{Jan 11 2017, 0.0.0}{Init ggPMX from Novartis rtemplate.} 20 | #' \item{Feb 06 2017, 0.3.0}{Import version 0.3.0 of package.} 21 | #' 22 | #' } 23 | #' 24 | #' @name ggPMX 25 | #' @docType package 26 | #' @importFrom R6 R6Class 27 | #' @import ggplot2 28 | #' @importFrom gtable gtable_add_cols gtable_add_rows 29 | #' @importFrom magrittr %>% 30 | #' @importFrom stringr str_trim 31 | #' @importFrom utils read.table assignInMyNamespace 32 | #' @importFrom yaml yaml.load_file 33 | #' @import data.table 34 | #' @importFrom assertthat assert_that 35 | #' @importFrom rlang .data 36 | #' @keywords internal 37 | "_PACKAGE" 38 | NULL 39 | -------------------------------------------------------------------------------- /R/ggforce-facet-paginate.R: -------------------------------------------------------------------------------- 1 | #' Determine the number of pages in a paginated facet plot 2 | #' 3 | #' This is a simple helper that returns the number of pages it takes to plot all 4 | #' panels when using \code{\link{facet_wrap_paginate}} . It partially builds the plot so depending 5 | #' on the complexity of your plot it might take some time to calculate... 6 | #' 7 | #' @param plot A ggplot object using either facet_wrap_paginate or 8 | #' facet_grid_paginate 9 | #' 10 | #' @return If the plot uses using either facet_wrap_paginate or 11 | #' facet_grid_paginate it returns the total number of pages. Otherwise it 12 | #' returns NULL 13 | #' @import ggplot2 14 | #' 15 | n_pages <- function(plot) { 16 | page <- ggplot_build(plot)$layout$panel_layout$page 17 | if (!is.null(page)) { 18 | max(page) 19 | } else { 20 | NULL 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /R/plot-themes.R: -------------------------------------------------------------------------------- 1 | #' Define ggPMX theme 2 | #' 3 | #' This theme is a simple wrapper gdoc theme 4 | #' from ggthems package. 5 | #' @param ... can contain any valid argument of \code{ggplot2} \code{\link[ggplot2]{theme}} 6 | #' object. 7 | 8 | #' @import ggplot2 9 | #' @export 10 | pmx_theme <- function(...) { 11 | theme_bw() + 12 | theme( 13 | strip.text = element_text(size = 14), 14 | ## strip.background = element_rect( colour = NA), 15 | plot.title = element_text(size = 12), 16 | axis.text = element_text(size = 10), 17 | #plot.margin = unit(c(1, 1, 1, 1), "cm"), 18 | legend.position = "none" 19 | ) %+replace% 20 | theme(...) 21 | } 22 | -------------------------------------------------------------------------------- /R/pmx-data.R: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # ## load data from an input 4 | # 5 | # ds <- 6 | # list( 7 | # predictions = function()readRDS("predictions.rds"), 8 | # finegrid=function()return(NULL), 9 | # eta = function()readRDS("etas.rds"), 10 | # estimates = function()readRDS("etas.rds"), 11 | # ) 12 | # 13 | # ctr <- theophylline() 14 | # 15 | # ctr %>% get_data("eta") 16 | -------------------------------------------------------------------------------- /R/pmx_manual_import.R: -------------------------------------------------------------------------------- 1 | # The ggPMX NONMEM reader (pmx_nm) is strongly based on NONMEM reading functions of the xpose package (v.0.4.11) (Thanks to Benjamin Guiastrennec) 2 | # 3 | #' Manually define nonmem tables to be imported 4 | #' 5 | #' @description Manually provide names of the table files to be imported. 6 | #' 7 | #' @param tab_names Provide the name of the tables to import e.g. 'sdtab', 'patab', 'cotab', 8 | #' 'catab' for NONMEM. 9 | #' @param tab_suffix Default is '', but can be changed to any character string to be used as 10 | #' suffix in the table names. 11 | #' @param sim_suffix Default is 'sim', but can be changed to any character string to be used as 12 | #' suffix in the simulation table names e.g. sdtab001sim. 13 | #' 14 | pmx_manual_nm_import <- function(tab_names = c('sdtab', 'mutab', 'patab', 'catab', 'cotab', 15 | 'mytab', 'extra', 'xptab', 'cwtab'), 16 | tab_suffix = '', sim_suffix = 'sim') { 17 | 18 | list(tab_suffix = tab_suffix, sim_suffix = sim_suffix, tab_names = tab_names) 19 | } 20 | 21 | 22 | #' Creates an nm_table_list from manually defined table name patterns 23 | #' 24 | #' @param runno Run number to be used to generate model file name. 25 | #' @param file Model file name containing the file extension. 26 | #' @param dir Location of the model files. 27 | #' @param tab_list A list of table definition generated by `pmx_manual_nm_import`. 28 | #' 29 | #' @return A `nm_table_list` 30 | #' 31 | #' @keywords internal 32 | pmx_list_nm_tables_manual <- function(runno = NULL, file = NULL, dir = NULL, tab_list) { 33 | . <- NULL 34 | if (is.null(runno)) { 35 | # Attempt to guess runno if file has been used 36 | runno <- stringr::str_match(string = pmx_update_extension(file, ''), 37 | pattern = '\\d.+$')[1,] 38 | if (is.na(runno)) { 39 | stop('Failed to guess `runno` from `file` argument. Check ?pmx_manual_nm_import for help.', 40 | call. = FALSE) 41 | } 42 | } 43 | pmx_file_path(dir, stringr::str_c(tab_list$tab_names, runno)) %>% 44 | dplyr::tibble(problem = 1, file = ., firstonly = FALSE, simtab = NA) %>% 45 | tidyr::expand(problem = .$problem, file = .$file, firstonly = .$firstonly, simtab = c(FALSE, TRUE)) %>% 46 | dplyr::mutate(file = dplyr::if_else(.$simtab, stringr::str_c(.$file, tab_list$sim_suffix), 47 | stringr::str_c(.$file, tab_list$tab_suffix))) %>% 48 | dplyr::filter(file.exists(.$file)) %>% 49 | pmx_as.nm.table.list() 50 | } 51 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | .onLoad <- function(libname = find.package("ggPMX"), pkgname = "ggPMX") { 2 | pmxOptions(template_dir = file.path(libname, pkgname, "templates")) 3 | } 4 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | This submission is mainly to fix the issues flagged by CRAN 2 | 3 | This submission also skips many tests on CRAN and removes vignettes 4 | because they take too long to run 5 | -------------------------------------------------------------------------------- /ggPMX.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: No 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: ASCII 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | PackageRoxygenize: rd,namespace 19 | -------------------------------------------------------------------------------- /inst/examples/controller.R: -------------------------------------------------------------------------------- 1 | \donttest{ 2 | 3 | ## Example to create the controller using theophylline data 4 | theophylline <- file.path(system.file(package = "ggPMX"), "testdata", 5 | "theophylline") 6 | WORK_DIR <- file.path(theophylline, "Monolix") 7 | input_file <- file.path(theophylline, "data_pk.csv") 8 | 9 | ## using only mandatory variables 10 | ctr <- pmx( 11 | sys="mlx", 12 | config = "standing", 13 | directory = WORK_DIR, 14 | input = input_file, 15 | dv = "Y", 16 | dvid ="DVID" 17 | ) 18 | ## Using covariates 19 | ctr <- pmx( 20 | sys="mlx", 21 | config = "standing", 22 | directory = WORK_DIR, 23 | input = input_file, 24 | dv = "Y", 25 | dvid ="DVID", 26 | cats=c("SEX"), 27 | conts=c("WT0","AGE0"), 28 | strats="STUD" 29 | ) 30 | ## using settings parameter 31 | ctr <- pmx( 32 | sys="mlx", 33 | config = "standing", 34 | directory = WORK_DIR, 35 | input = input_file, 36 | dv = "Y", 37 | dvid ="DVID", 38 | settings=list(is.draft=FALSE) 39 | ) 40 | 41 | ## using mlxtran file 42 | mlxtran_file <- 43 | file.path(system.file(package = "ggPMX"), 44 | "testdata","1_popPK_model","project.mlxtran") 45 | pmx_mlxtran(mlxtran_file) 46 | 47 | ## mlxtran , call =TRUE to get the pmx_mlx argument parsed by pmx_mlxtran 48 | params <- pmx_mlxtran(mlxtran_file,call=TRUE) 49 | 50 | str(params) 51 | # $ directory: chr results_pathile 52 | # $ input : chr observation file path 53 | # $ dv : chr "DV" 54 | # $ cats : chr [1:4] "SEX" "RACE" "DISE" "ILOW" 55 | # $ conts : chr [1:4] "AGE0" "WT0" "HT0" "TRT" 56 | # $ occ : chr "ISS" 57 | # $ dvid : chr "YTYPE" 58 | # $ endpoint :List of 5 59 | # ..$ code : chr "1" 60 | # ..$ label : chr "" 61 | # ..$ unit : chr "" 62 | # ..$ file.code: chr "1" 63 | # ..$ trans : NULL 64 | # ..- attr(*, "class")= chr "pmxEndpointClass" 65 | # $ config : chr "standing" 66 | } 67 | -------------------------------------------------------------------------------- /inst/examples/custom_inputs.yaml: -------------------------------------------------------------------------------- 1 | predictions : 2 | label : model predictions 3 | file : predictions.txt 4 | pattern: predictions_.txt 5 | reader : read_mlx_pred 6 | names: 7 | ID: id 8 | TIME: time 9 | PRED: poppred 10 | NPDE: npde 11 | IPRED: mlx_ipred 12 | IWRES: mlx_iwres 13 | -------------------------------------------------------------------------------- /inst/examples/distribution.R: -------------------------------------------------------------------------------- 1 | \donttest{ 2 | # *************** basic use ***************** ------ 3 | 4 | ctr <- theophylline() 5 | ## boxplot variation 6 | p <- ctr %>% pmx_plot_eta_box() 7 | ## histogram variation 8 | p <- ctr %>% pmx_plot_eta_hist() 9 | 10 | # update graphical parameter ---------------------- 11 | 12 | ## add jitter 13 | ctr %>% 14 | pmx_plot_eta_hist(is.jitter = TRUE, jitter = list(alpha = 0.4, color = "red")) 15 | 16 | ## remove shrinkage 17 | ctr %>% 18 | pmx_plot_eta_hist(is.shrink = FALSE) 19 | 20 | ## update histogram graphical parameters 21 | ctr %>% 22 | pmx_plot_eta_hist( 23 | histogram = list( 24 | color = NA, 25 | position = "fill", 26 | binwidth = 1 / 100 27 | ) 28 | ) 29 | 30 | 31 | 32 | # stratification ---------------------------------- 33 | 34 | ## categorical stratification color parameter 35 | ctr %>% pmx_plot_eta_hist(is.jitter = TRUE, strat.facet = ~STUD, strat.color = ~SEX) 36 | 37 | ## categorical stratification facetting 38 | ctr %>% pmx_plot_eta_hist(strat.facet = ~SEX) 39 | 40 | ## using formula categorical stratification facetting 41 | ctr %>% pmx_plot_eta_hist( 42 | strat.facet = STUD ~ SEX, 43 | shrink = pmx_shrink(hjust = 0.5) 44 | ) 45 | 46 | # subsetting -------------------------------------- 47 | 48 | ## select a set of random effect 49 | ctr %>% pmx_plot_eta_hist(filter = EFFECT %in% c("ka", "Cl")) 50 | ## filter and stratify by facets 51 | ctr %>% pmx_plot_eta_hist( 52 | filter = EFFECT %in% c("ka", "Cl"), strat.facet = ~SEX 53 | ) 54 | ctr %>% pmx_plot_eta_hist( 55 | filter = EFFECT %in% c("ka", "Cl"), strat.facet = ~SEX 56 | ) 57 | } 58 | -------------------------------------------------------------------------------- /inst/examples/endpoint.R: -------------------------------------------------------------------------------- 1 | \donttest{ 2 | ## Use file.code parameter 3 | pk_pd_path <- file.path(system.file(package = "ggPMX"), "testdata","pk_pd") 4 | 5 | WORK_DIR <- file.path(pk_pd_path, "RESULTS") 6 | 7 | ep <- pmx_endpoint( 8 | code="4", 9 | file.code="2" 10 | ) 11 | 12 | input_file <- file.path(pk_pd_path, "pk_pd.csv") 13 | 14 | ctr <- pmx_mlx( 15 | config = "standing", 16 | directory = WORK_DIR, 17 | input = input_file, 18 | dv = "dv", 19 | dvid = "dvid", 20 | cats = "sex", 21 | conts = "wt", 22 | endpoint = ep 23 | ) 24 | 25 | ## using mlxtran 26 | 27 | ep <- pmx_endpoint( 28 | code="3", 29 | file.code="1" 30 | ) 31 | 32 | mlxtran_file <- file.path(pk_pd_path, "pk_pd.mlxtran") 33 | ctr <- pmx_mlxtran(mlxtran_file,endpoint=ep) 34 | } 35 | -------------------------------------------------------------------------------- /inst/examples/eta_cov.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | \donttest{ 4 | # basic use --------------------------------------- 5 | 6 | ctr <- theophylline() 7 | ctr %>% pmx_plot_eta_cats 8 | ctr %>% pmx_plot_eta_conts 9 | 10 | # update graphical parameter ---------------------- 11 | 12 | ## update labels 13 | ctr %>% pmx_plot_eta_cats( 14 | labels = list(title = "New eta cats title") 15 | ) 16 | 17 | ## remove draft 18 | ctr %>% pmx_plot_eta_cats(is.draft = FALSE) 19 | 20 | ## change text color line 21 | ctr %>% pmx_plot_eta_conts( 22 | correl=list(colour="magenta") 23 | ) 24 | 25 | ## set covariates custom labels 26 | 27 | ctr %>% pmx_plot_eta_conts( 28 | covariates=pmx_cov(values=list("WT0","AGE0"), 29 | labels=list("Weight","Age")) 30 | ) 31 | 32 | ## set effects and covaraites custom labels 33 | 34 | 35 | ctr <- theophylline( settings = pmx_settings( 36 | effects=list( levels=c("ka", "V", "Cl"), 37 | labels=c("Concentration","Volume","Clearance") 38 | ) 39 | ) 40 | ) 41 | ctr %>% pmx_plot_eta_conts( 42 | covariates=pmx_cov(values=list("WT0","AGE0"), 43 | labels=list("Weight","Age")) 44 | ) 45 | 46 | } 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /inst/examples/eta_matrix.R: -------------------------------------------------------------------------------- 1 | 2 | \donttest{ 3 | 4 | # basic use --------------------------------------- 5 | 6 | ctr <- theophylline() 7 | p <- ctr %>% pmx_plot_eta_matrix 8 | 9 | # update graphical parameter ---------------------- 10 | 11 | ## update labels 12 | ctr %>% pmx_plot_eta_matrix( 13 | labels = list(title = "Eta matrix new title") 14 | ) 15 | 16 | ## remove draft 17 | ctr %>% pmx_plot_eta_matrix(is.draft = FALSE) 18 | 19 | ## change text color line 20 | ctr %>% pmx_plot_eta_matrix( 21 | text_color="red", 22 | shrink=pmx_shrink(mapping=aes(color="magenta")) 23 | ) 24 | 25 | ## custom point aes and static parameters 26 | ## we can customize any geom_point parameter 27 | ctr %>% pmx_plot_eta_matrix( 28 | point = list(color = "blue", shape = 4) 29 | ) 30 | 31 | 32 | 33 | # stratification ---------------------------------- 34 | 35 | ## IGNORE continuous stratification 36 | ctr %>% pmx_plot_eta_matrix(strat.color = "WT0") 37 | ## IGNORE categorical stratification 38 | ctr %>% pmx_plot_eta_matrix(strat.facet = ~SEX) 39 | 40 | # subsetting -------------------------------------- 41 | 42 | ## we can use any expression involving the data 43 | ctr %>% pmx_plot_eta_matrix(filter = EFFECT%in% c("Cl","ka")) 44 | } 45 | -------------------------------------------------------------------------------- /inst/examples/ggpmx_nlmixr.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | library(nlmixr) 5 | 6 | # one.compartment <- function() { 7 | # ini({ 8 | # tka <- 0.45 # Log Ka 9 | # tcl <- 1 # Log Cl 10 | # tv <- 3.45 # Log V 11 | # eta.ka ~ 0.6 12 | # eta.cl ~ 0.3 13 | # eta.v ~ 0.1 14 | # add.sd <- 0.7 15 | # }) 16 | # model({ 17 | # ka <- exp(tka + eta.ka) 18 | # cl <- exp(tcl + eta.cl) 19 | # v <- exp(tv + eta.v) 20 | # d/dt(depot) = -ka * depot 21 | # d/dt(center) = ka * depot - cl / v * center 22 | # cp = center / v 23 | # cp ~ add(add.sd) 24 | # }) 25 | # } 26 | # 27 | # fit <- nlmixr(one.compartment, theo_sd, "saem", control=list(print=0)) 28 | library(ggPMX) 29 | ctr <- pmx_nlmixr(fit, conts = c("cl","v")) 30 | 31 | ctr %>% pmx_plot_dv_ipred 32 | ctr %>% pmx_plot_dv_pred 33 | ctr %>% pmx_plot_abs_iwres_ipred 34 | ctr %>% pmx_plot_individual(1) 35 | ctr %>% pmx_plot_iwres_dens 36 | ctr %>% pmx_plot_npde_qq 37 | ctr %>% pmx_plot_npde_pred 38 | ctr %>% pmx_plot_npde_time 39 | ctr %>% pmx_plot_eta_qq 40 | ctr %>% pmx_plot_vpc 41 | ctr %>% pmx_plot_eta_box 42 | ctr %>% pmx_plot_eta_hist 43 | ctr %>% pmx_plot_eta_matrix 44 | 45 | ctr %>% pmx_report("nlmixr_report","/tmp") 46 | -------------------------------------------------------------------------------- /inst/examples/individual.R: -------------------------------------------------------------------------------- 1 | # basic use --------------------------------------- 2 | \donttest{ 3 | ctr <- theophylline() 4 | ctr %>% pmx_plot_individual(which_pages = 1) 5 | ## multiple pages 6 | ctr %>% pmx_plot_individual(which_pages = c(1, 3)) 7 | ## change faceting 8 | ctr %>% pmx_plot_individual(facets = list(nrow = 5, ncol = 5), which_pages = 2) 9 | 10 | 11 | # update graphical parameter ---------------------- 12 | 13 | ## update labels 14 | ctr %>% pmx_plot_individual( 15 | labels = list(title = "Custom individual plot") 16 | ) 17 | 18 | ## remove draft 19 | ctr %>% pmx_plot_individual(is.draft = FALSE) 20 | 21 | ## Customize ipred_line with any geom_line parameter 22 | ctr %>% pmx_plot_individual( 23 | pred_line = list(color = "red", linetype = 20, alpha = 0.5) 24 | ) 25 | 26 | ## Customize ipred_line with any geom_line parameter 27 | ctr %>% pmx_plot_individual( 28 | ipred_line = list(size = 5) 29 | ) 30 | 31 | 32 | ## Customize any geom_point parameter 33 | ctr %>% pmx_plot_individual( 34 | point = list(aes(alpha = DV), color = "green", shape = 4) 35 | ) 36 | 37 | 38 | ## legend 39 | 40 | p <- ctr %>% pmx_plot_individual( 41 | is.legend=TRUE, 42 | point=list(shape=20), 43 | pred_line=list(linetype=6) 44 | ) 45 | 46 | # # stratification ---------------------------------- 47 | # 48 | # ## continuous stratification 49 | ctr %>% pmx_plot_individual(strat.color = "WT0") 50 | 51 | # # subsetting -------------------------------------- 52 | # 53 | # ## we can use any expression involving the data 54 | # ## filter and stratify 55 | ctr %>% pmx_plot_individual( 56 | filter = SEX == 1, strat.facet = ~SEX, 57 | facets = list(nrow = 5, ncol = 5)) 58 | 59 | # # transformation -------------------------------------- 60 | # 61 | # ## apply a log transformation in y 62 | ctr %>% pmx_plot_individual(trans = "log10_y") 63 | # ## apply a custonm trsnformation to normalize axis between 0 and 1 64 | 65 | ## get a list of parameter 66 | p <- ctr %>% pmx_plot_individual( 67 | which_pages="all", 68 | point=list(shape=4,color='blue',size=10), 69 | facets = list(nrow = 5, ncol = 5), 70 | labels = list(title = "My individuals",x='my time',y='PD data') 71 | ) 72 | 73 | } 74 | -------------------------------------------------------------------------------- /inst/examples/plots.yaml: -------------------------------------------------------------------------------- 1 | CUSTOM_RES_TIME: 2 | ptype: SCATTER 3 | x: TIME 4 | 'y': IWRES 5 | labels: 6 | title: IWRES vs TIME 7 | subtitle: '' 8 | x: TIME 9 | 'y': Individual predictions 10 | point: 11 | shape: 20 12 | color: black 13 | size: 3.0 14 | is.hline: yes 15 | is.smooth: yes 16 | smooth: 17 | se: no 18 | color: red 19 | linetype: 1.0 20 | method: lm 21 | 22 | CUSTOM_NPDE_TIME: 23 | ptype: SCATTER 24 | x: TIME 25 | 'y': NPDE 26 | labels: 27 | title: NPDE vs TIME 28 | subtitle: '' 29 | x: TIME 30 | 'y': NPDE 31 | point: 32 | shape: 1.0 33 | color: black 34 | size: 1.0 35 | is.hline: yes 36 | is.band: yes 37 | is.smooth: yes 38 | smooth: 39 | se: no 40 | color: red 41 | linetype: 2.0 42 | strat.facet: ~SEX 43 | -------------------------------------------------------------------------------- /inst/examples/pmx-settings.R: -------------------------------------------------------------------------------- 1 | \donttest{ 2 | 3 | library(ggPMX) 4 | library(ggplot2) 5 | ctr <- theophylline( 6 | settings= 7 | pmx_settings( 8 | color.scales=list( 9 | "Study", 10 | labels=c("Study 1","Study 2"), 11 | values=c("1"="lightyellow","2"="lightblue")), 12 | cats.labels=list( 13 | SEX=c("0"="M","1"="F"), 14 | STUD=c("1"="Study 1","2"="Study 2") 15 | ), 16 | use.abbrev=TRUE, 17 | is.draft=TRUE, 18 | use.labels=TRUE 19 | ) 20 | ) 21 | 22 | 23 | 24 | ctr %>% 25 | pmx_plot_npde_time(strat.color="STUD",strat.facet=~SEX) 26 | # 27 | # 28 | ctr %>% 29 | pmx_plot_eta_box(strat.color="STUD", strat.facet =~SEX) 30 | 31 | ctr %>% pmx_plot_eta_hist 32 | } 33 | -------------------------------------------------------------------------------- /inst/examples/pmx_config.R: -------------------------------------------------------------------------------- 1 | # *************** Create a controller using custom plot configuration ***************** ------ 2 | 3 | library(ggPMX) 4 | theophylline <- file.path( 5 | system.file(package = "ggPMX"), "testdata", 6 | "theophylline" 7 | ) 8 | WORK_DIR <- file.path(theophylline, "Monolix") 9 | input_file <- file.path(theophylline, "data_pk.csv") 10 | 11 | 12 | # create a controller with a custom plots template 13 | ctr <- pmx_mlx( 14 | config = pmx_config( 15 | plots=file.path( system.file(package = "ggPMX"),"examples/plots.yaml"), 16 | inputs = system.file(package = "ggPMX","examples/custom_inputs.yaml") 17 | ), 18 | directory = WORK_DIR, 19 | input = input_file, 20 | dv = "Y", 21 | dvid = "DVID", 22 | cats = c("SEX"), 23 | conts = c("WT0", "AGE0"), 24 | strats = "STUD" 25 | ) 26 | 27 | ## get the list of plots 28 | ctr %>% plots 29 | ctr %>% get_plot("custom_res_time") 30 | ctr %>% get_plot("custom_npde_time") 31 | 32 | -------------------------------------------------------------------------------- /inst/examples/pmx_nm.R: -------------------------------------------------------------------------------- 1 | ## using only runnumber 2 | # ctr <- pmx_nm( 3 | # directory=model_dir, 4 | # runno = "001" 5 | #) 6 | 7 | ## using a model file (e.g. run001.lst) 8 | #ctr <- pmx_nm( 9 | # directory=model_dir, 10 | # file = "run001.lst" 11 | #) 12 | 13 | ## if simulation was performed post-hoc, an additional simulation file can be loaded for VPC 14 | #ctr <- pmx_nm( 15 | # directory=model_dir, 16 | # file = "run001.lst", 17 | # simfile = "simulation.ctl" 18 | #) 19 | 20 | ## loading with individual table(s)-names 21 | #ctr <- pmx_nm(directory = model_dir, 22 | # runno = 3, 23 | # table_names = "xptab") 24 | -------------------------------------------------------------------------------- /inst/examples/pmx_report.R: -------------------------------------------------------------------------------- 1 | \donttest{ 2 | 3 | library(ggPMX) 4 | # you probably want to create the report in your own directory 5 | # But using a temp directory allows for easy cleanup 6 | 7 | ## case1: generate a single report 8 | withr::with_tempdir({ 9 | ctr <- theophylline() 10 | ctr %>% pmx_report( 11 | name = "my_report", 12 | save_dir = getwd(), 13 | output="report" 14 | ) 15 | }) 16 | 17 | 18 | ## case2: generate standalone plots 19 | withr::with_tempdir({ 20 | ctr <- theophylline() 21 | ctr %>% pmx_report( 22 | name = "my_report", 23 | save_dir = getwd(), 24 | output="plots" 25 | ) 26 | }) 27 | 28 | 29 | ## case3: generate both : reports + plots 30 | ## by default add footnote 31 | ## Note, you can force footnote to FALSE using footnote parameter 32 | withr::with_tempdir({ 33 | ctr <- theophylline() 34 | ctr %>% pmx_report( 35 | name="my_report", 36 | save_dir=getwd(), 37 | output="all" 38 | ) 39 | }) 40 | 41 | 42 | ## case4 : generate standalone plots with footnotes 43 | withr::with_tempdir({ 44 | ctr <- theophylline() 45 | ctr %>% pmx_report( 46 | name="my_report", 47 | save_dir=getwd(), 48 | footnote=TRUE, 49 | output="plots" 50 | ) 51 | }) 52 | 53 | 54 | ## case6: dynamic edit 55 | ## uncomment to run 56 | # ctr <- theophylline() 57 | # ctr %>% pmx_report( 58 | # save_dir = file.path(getwd(),"case6"), 59 | # name="my_report", 60 | # output="report", 61 | # edit = TRUE) 62 | 63 | 64 | ## case7 : generate individual plots report 65 | ## ctr <- theophylline() 66 | ## ctr %>% pmx_report( 67 | ## name="report2", 68 | ## save_dir = getwd(), 69 | ## template="individual", 70 | ## format="all", 71 | ## which_pages=1:2 72 | ## ) 73 | } 74 | -------------------------------------------------------------------------------- /inst/examples/qq.R: -------------------------------------------------------------------------------- 1 | 2 | \donttest{ 3 | # *************** basic use ***************** ------ 4 | 5 | ctr <- theophylline() 6 | ctr %>% pmx_plot_eta_qq 7 | ctr %>% pmx_plot_npde_qq 8 | ctr %>% pmx_plot_iwres_qq 9 | 10 | # update graphical parameter ---------------------- 11 | 12 | ## add reference line 13 | ctr %>% pmx_plot_npde_qq(reference_line=list(color="blue")) 14 | 15 | ## remove reference line 16 | ctr %>% pmx_plot_eta_qq(reference_line=NULL) 17 | 18 | 19 | # stratification ---------------------------------- 20 | 21 | ## categorical stratification color parameter 22 | ctr %>% pmx_plot_iwres_qq(strat.facet=~STUD,strat.color="SEX") 23 | ## categorical stratification facetting 24 | ctr %>% pmx_plot_eta_qq(strat.facet = ~SEX) 25 | 26 | ## do not use symmetric axis 27 | ctr %>% pmx_plot_npde_qq(xmax=FALSE,reference_line=list()) 28 | } 29 | 30 | -------------------------------------------------------------------------------- /inst/examples/residual.R: -------------------------------------------------------------------------------- 1 | \donttest{ 2 | # NOTES ###################### 3 | # examples are availables for all residual plots: 4 | # - pmx_plot_abs_iwres_ipred 5 | # - pmx_plot_dv_ipred 6 | # - pmx_plot_dv_pred 7 | # - pmx_plot_iwres_ipred 8 | # - pmx_plot_iwres_time 9 | # - pmx_plot_npde_time 10 | 11 | 12 | # basic use --------------------------------------- 13 | 14 | ctr <- theophylline() 15 | p <- ctr %>% pmx_plot_dv_pred() 16 | ## p is a ggplot2 object you can add any layer here 17 | p + ggplot2::theme_minimal() 18 | 19 | # update graphical parameter ---------------------- 20 | 21 | ## update labels 22 | ctr %>% pmx_plot_dv_pred( 23 | labels = list(title = "DV versus PRED new title") 24 | ) 25 | 26 | ## remove draft 27 | ctr %>% pmx_plot_dv_pred(is.draft = FALSE) 28 | 29 | ## remove horizontal line 30 | ctr %>% pmx_plot_dv_pred(is.hline = FALSE) 31 | 32 | ## custom point aes and static parameters 33 | ## we can customize any geom_point parameter 34 | ctr %>% pmx_plot_dv_pred( 35 | point = list(aes(alpha = DV), color = "green", shape = 4) 36 | ) 37 | 38 | 39 | 40 | # stratification ---------------------------------- 41 | 42 | ## continuous stratification 43 | ctr %>% pmx_plot_dv_pred(strat.color = ~WT0) 44 | ## categorical stratification 45 | ctr %>% pmx_plot_dv_pred(strat.facet = ~SEX) 46 | ## using formula notation 47 | ctr %>% pmx_plot_dv_pred(strat.facet = STUD~SEX) 48 | 49 | # subsetting -------------------------------------- 50 | 51 | ## we can use any expression involving the data 52 | ctr %>% pmx_plot_dv_pred(filter = DV > mean(DV) & PRED < median(PRED)) 53 | ## filter and stratify 54 | ctr %>% pmx_plot_dv_pred(filter = SEX == 1, strat.facet = ~SEX) 55 | 56 | 57 | # transformation -------------------------------------- 58 | 59 | ## apply a log transformation in y 60 | ctr %>% pmx_plot_dv_pred(trans = "log10_y") 61 | } 62 | -------------------------------------------------------------------------------- /inst/examples/templates/custom_report.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | date: "`r format(Sys.time(), '%d %B, %Y')`" 3 | output: 4 | pdf_document: 5 | toc: true 6 | word_document: 7 | toc: true 8 | --- 9 | 10 | --- 11 | params: 12 | ctr: "" 13 | title: "" 14 | --- 15 | --- 16 | subtitle: `r params$ctr$save_dir` 17 | title: `r params$title ` 18 | --- 19 | 20 | 21 | ```{r setup, include=FALSE} 22 | knitr::opts_chunk$set(echo = FALSE,message=FALSE) 23 | cats <- ctr %>% get_cats 24 | 25 | ``` 26 | 27 | 28 | # Key model diagnostics 29 | 30 | ```{r npde_pred} 31 | ctr %>% pmx_plot_npde_pred 32 | ``` 33 | -------------------------------------------------------------------------------- /inst/examples/templates/misc.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | date: "`r format(Sys.time(), '%d %B, %Y')`" 3 | output: 4 | pdf_document: 5 | toc: true 6 | word_document: 7 | toc: true 8 | --- 9 | 10 | --- 11 | params: 12 | ctr: "" 13 | title: "" 14 | --- 15 | --- 16 | subtitle: `r params$ctr$save_dir` 17 | title: `r params$title ` 18 | --- 19 | 20 | ```{r setup, include=FALSE,fig.cap="toto"} 21 | cats <- ctr %>% get_cats 22 | 23 | ``` 24 | 25 | 26 | # Key model diagnostics 27 | 28 | 29 | ## multiple ggPMX 30 | 31 | We can create many plots under the same chunk. 32 | ```{r multiple_ggpmx,pmx=TRUE} 33 | ctr %>% pmx_plot_iwres_time 34 | 35 | ctr %>% pmx_plot_dv_ipred 36 | 37 | ctr %>% pmx_plot_eta_box 38 | ``` 39 | 40 | 41 | ## no ggPMX included 42 | 43 | To include custom plot within the ggPMX framework , we should register the created plot. Here we are using `pmx_register_plot`. If we are in a case that we need to add footnote , ggPMX will add the right footnote under the custom plot. 44 | 45 | ```{r no_ggpmx,message=FALSE, warning=FALSE} 46 | library(ggplot2) 47 | inn <- ctr %>% get_data("input") 48 | pp <- ggplot(inn, aes(WT0,AGE0)) + geom_smooth() + pmx_theme() 49 | ctr %>% pmx_register_plot(pp,"age0_vs_wt0") 50 | ``` 51 | 52 | ## no ggPMX + ggPMX 53 | 54 | We can mix ggPMX and no ggPMX plots under the same chunk. Note that here if we do not register pp, footnotes may wrong; see section on Erroneous usage. 55 | 56 | ```{r ggpmx_no_ggpmx} 57 | pp 58 | ``` 59 | 60 | Here we register the custom plot: 61 | ```{r ggpmx_no_ggpmx_regsitred} 62 | ctr %>% pmx_register_plot(pp,"age0_vs_wt0") 63 | ctr %>% pmx_plot_eta_box 64 | ``` 65 | 66 | ## Erroneous usage of package 67 | 68 | When mixing ggPMX plots and other plots within one chunk, the package cannot keep track of the numbering of plots. 69 | Footnotes may be wrong. `ggPMX` will throw a message to indicate that the plot was not regisered. 70 | 71 | ```{r error1} 72 | inn <- ctr %>% get_data("input") 73 | ggplot(inn, aes(WT0,AGE0)) + geom_point() 74 | 75 | print(ctr %>% pmx_plot_iwres_time) 76 | 77 | 78 | ``` 79 | 80 | Similarly, when plotting a ggPMX plot twice, the package cannot keep track of the numbering of plots. 81 | Footnotes may be wrong. `ggPMX` will throw a message to indicate that the plot was not regisered. 82 | 83 | ```{r error2} 84 | pp <- ctr %>% pmx_plot_iwres_time 85 | plot(pp) 86 | plot(pp + scale_x_log10()) 87 | ``` 88 | 89 | Plot that does not get rendered will throw error to prevent errors in footnotes. 90 | 91 | ```{r error3} 92 | # for(i in 1:2) { 93 | # ctr %>% pmx_plot_iwres_time 94 | # } 95 | # ctr %>% pmx_plot_iwres_time 96 | 97 | 98 | ``` 99 | 100 | 101 | -------------------------------------------------------------------------------- /inst/examples/vpc.R: -------------------------------------------------------------------------------- 1 | \donttest{ 2 | library(ggPMX) 3 | 4 | theo_path <- file.path( 5 | system.file(package = "ggPMX"), "testdata", 6 | "theophylline" 7 | ) 8 | WORK_DIR <- file.path(theo_path, "Monolix") 9 | input_file <- file.path(theo_path, "data_pk.csv") 10 | vpc_file <- file.path(theo_path, "sim.csv") 11 | 12 | ctr <- pmx_mlx( 13 | config = "standing", 14 | directory = WORK_DIR, 15 | input = input_file, 16 | dv = "Y", 17 | dvid = "dvid", 18 | cats = c("SEX"), 19 | conts = c("WT0", "AGE0"), 20 | strats = "STUD", 21 | settings = pmx_settings( 22 | use.labels=TRUE, 23 | cats.labels=list( 24 | SEX=c("0"="Male","1"="Female") 25 | ) 26 | ), 27 | sim = pmx_sim( 28 | file = vpc_file, 29 | irun ="rep", 30 | idv="TIME" 31 | ) 32 | ) 33 | 34 | 35 | ctr %>% pmx_plot_vpc( 36 | strat.facet=~SEX, 37 | facets=list(nrow=2), 38 | type="percentile", 39 | is.draft = FALSE, 40 | pi = pmx_vpc_pi(interval = c(0.1,0.9), 41 | median=list(color="green"), 42 | extreme= list(color="green")), 43 | obs = pmx_vpc_obs(color="blue",shape=18,size=2), 44 | ci = pmx_vpc_ci(interval = c(0.1,0.9), 45 | median=list(fill="pink")), 46 | bin=pmx_vpc_bin("kmeans",n=5) 47 | ) 48 | 49 | ctr %>% 50 | pmx_plot_vpc(bin= pmx_vpc_bin( 51 | style = "fixed", 52 | fixedBreaks=c(-10,2, 5, 10,15,50)) 53 | ) 54 | 55 | # example with legend 56 | 57 | ctr %>% pmx_plot_vpc( 58 | is.legend = TRUE, 59 | pi = pmx_vpc_pi(interval=c(0.02,0.98),median = list(linetype="dotted")), 60 | ci = pmx_vpc_ci(interval = c(0.05,0.95),median=list(fill="red")) 61 | ) 62 | 63 | } 64 | -------------------------------------------------------------------------------- /inst/extra/run-oq.R: -------------------------------------------------------------------------------- 1 | # Script to perform the Operation Qualification 2 | # --------------------------------------------- 3 | # 4 | # Do not edit without checking back with Inga. 5 | 6 | library(testthat) 7 | library(ggPMX) 8 | 9 | cat("TEST RUN DATE:", date(), "\n") 10 | 11 | cat("TESTING PACKAGE:\n") 12 | print(packageDescription("ggPMX")) 13 | 14 | cat("RUNNING PACKAGE TESTS:\n") 15 | # Run each section separately to get subsequent numbering per section 16 | # of the TAP reporter; execution order must be aligned with steps described 17 | # in the main vignette (introduction.Rmd) 18 | for(test in c("test-reader", # Step 1: Read data, using standard configuration 19 | "test-gpar", # Step 2: Set graphics settings 20 | "test-plot", # Step 3: generate standard plots 21 | "misc" # Additional tests 22 | )) { 23 | test_package("ggPMX", filter=test, reporter="tap") 24 | } 25 | 26 | # Finally run all tests once more, but with the stop reporter. This 27 | # ensures that the last line of this script is only displayed if and 28 | # only if all tests run successful 29 | test_package("ggPMX", reporter="stop") 30 | 31 | cat("\n\nR SESSION INFO:\n") 32 | 33 | print(sessionInfo()) 34 | 35 | cat("\nTEST FINISH DATE:", date(), "\n") 36 | cat("\n\nALL TESTS SUCCESSFUL\n") 37 | 38 | -------------------------------------------------------------------------------- /inst/init/abbrev.yaml: -------------------------------------------------------------------------------- 1 | AIC: Akaike information criterion 2 | BIC: Bayesian information criterion 3 | BLQ: Below the limit of quantification 4 | COAR: Clinical Operations Analytics and Regions 5 | DV: Observations 6 | ETA: Inter-individual random effect 7 | EBE: Empirical Bayes estimate 8 | FO: First order 9 | FOCE: First order conditional estimation 10 | FOCEI: First order conditional estimation with interaction 11 | IIV: Inter-individual variability 12 | IPRED: Individual predictions 13 | LRT: Likelihood ratio test 14 | M&S: Modeling & Simulation 15 | NLME: Nonlinear mixed-effects (model) 16 | NPD: Normalized prediction discrepancy 17 | NPDE: Normalized prediction distribution error 18 | OCP: Oncology Clinical Pharmacology 19 | OFV: Objective function value 20 | PD: Pharmacodynamics 21 | PK: Pharmacokinetics 22 | PDF: Probability density function 23 | SAEM: Stochastic approximation of the expectation-minimization algorithm 24 | VPC: Visual predictive check 25 | PRED: Population predictions 26 | EPRED: Population averaged predictions 27 | CPRED: Conditional Population predictions 28 | IWRES: Individual weighted residuals 29 | '|IWRES|': '|Individual weighted residuals|' 30 | NVS: Novartis internal report 31 | HA: Report submitted to Health Authorities 32 | TIME: Time after first dose (hours) 33 | -------------------------------------------------------------------------------- /inst/init/cwres.ppmx: -------------------------------------------------------------------------------- 1 | ## CWRES plots 2 | CWRES_TIME: 3 | ptype: SCATTER 4 | x: TIME 5 | 'y': CWRES 6 | labels: 7 | title: CWRES vs TIME 8 | subtitle: '' 9 | x: TIME 10 | 'y': CWRES 11 | point: 12 | shape: 1.0 13 | colour: black 14 | size: 1.0 15 | is.hline: yes 16 | is.band: yes 17 | is.smooth: yes 18 | smooth: 19 | se: no 20 | colour: red 21 | linetype: 1.0 22 | bloq: 23 | show: yes 24 | cens: CENS 25 | limit: LIMIT 26 | colour: pink 27 | size: 2.0 28 | linewidth: 2.0 29 | alpha: 0.9 30 | 31 | CWRES_CPRED: 32 | ptype: SCATTER 33 | x: CPRED 34 | 'y': CWRES 35 | labels: 36 | title: CWRES vs CPRED 37 | subtitle: '' 38 | x: CPRED 39 | 'y': CWRES 40 | point: 41 | shape: 1.0 42 | colour: black 43 | size: 1.0 44 | is.hline: yes 45 | hline: 46 | colour: black 47 | is.band: yes 48 | is.smooth: yes 49 | smooth: 50 | se: no 51 | colour: red 52 | linetype: 1.0 53 | bloq: 54 | show: yes 55 | cens: CENS 56 | limit: LIMIT 57 | colour: pink 58 | size: 2.0 59 | linewidth: 2.0 60 | alpha: 0.9 61 | 62 | CWRES_PRED: 63 | ptype: SCATTER 64 | x: PRED 65 | 'y': CWRES 66 | labels: 67 | title: CWRES vs PRED 68 | subtitle: '' 69 | x: PRED 70 | 'y': CWRES 71 | point: 72 | shape: 1.0 73 | colour: black 74 | size: 1.0 75 | is.hline: yes 76 | hline: 77 | colour: black 78 | is.band: yes 79 | is.smooth: yes 80 | smooth: 81 | se: no 82 | colour: red 83 | linetype: 1.0 84 | bloq: 85 | show: yes 86 | cens: CENS 87 | limit: LIMIT 88 | colour: pink 89 | size: 2.0 90 | linewidth: 2.0 91 | alpha: 0.9 92 | 93 | CWRES_QQ: 94 | ptype: PMX_QQ 95 | x: CWRES 96 | labels: 97 | title: '' 98 | subtitle: '' 99 | x: Standard Normal Quantiles 100 | 'y': CWRES Quantiles 101 | is.reference_line: yes 102 | reference_line: 103 | color: black 104 | -------------------------------------------------------------------------------- /inst/init/defaults.yaml: -------------------------------------------------------------------------------- 1 | RES: 2 | labels: 3 | title: Residual plot 4 | subtitle: '' 5 | 'y': '' 6 | x: '' 7 | point: 8 | shape: 1.0 9 | colour: black 10 | size: 1.0 11 | is.hline: no 12 | is.smooth: yes 13 | smooth_with_bloq: no 14 | smooth: 15 | se: no 16 | colour: red 17 | linetype: 1.0 18 | square_plot: yes 19 | 20 | DIS_hist: 21 | type: hist 22 | dname: eta 23 | facets: 24 | scales: free_x 25 | nrow: 3.0 26 | is.shrink: yes 27 | shrink: 28 | fun: sd 29 | size: 4.0 30 | colour: black 31 | hjust: -1 32 | vjust: 2 33 | annotation: shrinkage 34 | histogram: 35 | binwidth: 0.034 36 | position: dodge 37 | fill: white 38 | colour: black 39 | labels: 40 | title: EBE distribution 41 | subtitle: '' 42 | x: '' 43 | 'y': '' 44 | legend: Random effect 45 | 46 | DIS_box: 47 | dname: eta 48 | type: box 49 | is.jitter: yes 50 | jitter: 51 | shape: 1.0 52 | colour: grey50 53 | width: 0.1 54 | height: 0.1 55 | alpha: 0.3 56 | is.shrink: yes 57 | shrink: 58 | fun: sd 59 | size: 4.0 60 | colour: black 61 | hjust: -1.5 62 | vjust: 2.0 63 | annotation: shrinkage 64 | labels: 65 | title: EBE distribution 66 | subtitle: '' 67 | x: '' 68 | 'y': '' 69 | legend: Random effect 70 | 71 | IND: 72 | ptype: IND 73 | dname: IND 74 | ranges: ~ 75 | is.smooth: no 76 | smooth_with_bloq: no 77 | ipred_line: 78 | colour: black 79 | linewidth: 1 80 | pred_line: 81 | colour: black 82 | linewidth: 1 83 | point: 84 | colour: black 85 | shape : 21 86 | size: 1 87 | is.legend: no 88 | which_pages: all 89 | print: TRUE 90 | facets: 91 | ncol: 3 92 | nrow: 7 93 | scales: free 94 | labels: 95 | title: Individual fits 96 | subtitle: '' 97 | x: TIME 98 | 'y': DV 99 | use.finegrid: yes 100 | 101 | ETA_PAIRS: 102 | title: Correlations of random effects 103 | dname: eta 104 | type.eta: mode 105 | text_color: black 106 | labels: 107 | title: '' 108 | subtitle: '' 109 | x: '' 110 | 'y': '' 111 | 112 | ETA_COV: 113 | type: cats 114 | labels: 115 | title: '' 116 | subtitle: '' 117 | x: '' 118 | 'y': '' 119 | 120 | ETA_CONTS: 121 | type: conts 122 | labels: 123 | title: '' 124 | subtitle: '' 125 | x: '' 126 | 'y': '' 127 | 128 | PMX_QQ: 129 | ptype: PMX_QQ 130 | labels: 131 | title: '' 132 | subtitle: '' 133 | x: '' 134 | 'y': '' 135 | 136 | -------------------------------------------------------------------------------- /inst/init/gpar.yaml: -------------------------------------------------------------------------------- 1 | is.title: yes 2 | labels: ~ 3 | axis.title: 4 | size: 12.0 5 | axis.text: 6 | size: 10.0 7 | ranges: ~ 8 | is.smooth: yes 9 | smooth: 10 | se: no 11 | linetype: 1.0 12 | linewidth: 1.5 13 | method: loess 14 | colour: red 15 | is.band: no 16 | band: 17 | 'yintercept': 18 | - -1.96 19 | - 1.96 20 | linetype: 2.0 21 | linewidth: 0.5 22 | is.draft: yes 23 | draft: 24 | size: 5.0 25 | label: DRAFT 26 | colour: grey50 27 | x: .inf 28 | 'y': -.inf 29 | discrete: no 30 | is.identity_line: no 31 | identity_line: 32 | colour: blue 33 | intercept: 0 34 | scale_x_log10: no 35 | scale_y_log10: no 36 | color.scales: ~ 37 | is.legend: no 38 | legend.position: right 39 | 40 | 41 | -------------------------------------------------------------------------------- /inst/init/npd.ppmx: -------------------------------------------------------------------------------- 1 | ## NPD plots 2 | 3 | NPD_TIME: 4 | ptype: SCATTER 5 | x: TIME 6 | 'y': NPD 7 | labels: 8 | title: NPD vs TIME 9 | subtitle: '' 10 | x: TIME 11 | 'y': NPD 12 | point: 13 | shape: 1.0 14 | colour: black 15 | size: 1.0 16 | is.hline: yes 17 | is.band: yes 18 | is.smooth: yes 19 | smooth: 20 | se: no 21 | colour: red 22 | linetype: 1.0 23 | bloq: 24 | show: yes 25 | cens: CENS 26 | limit: LIMIT 27 | colour: pink 28 | size: 2.0 29 | linewidth: 2.0 30 | alpha: 0.9 31 | 32 | NPD_EPRED: 33 | ptype: SCATTER 34 | x: EPRED 35 | 'y': NPD 36 | labels: 37 | title: NPD vs EPRED 38 | subtitle: '' 39 | x: EPRED 40 | 'y': NPD 41 | point: 42 | shape: 1.0 43 | colour: black 44 | size: 1.0 45 | is.hline: yes 46 | hline: 47 | colour: black 48 | is.band: yes 49 | is.smooth: yes 50 | smooth: 51 | se: no 52 | colour: red 53 | linetype: 1.0 54 | bloq: 55 | show: yes 56 | cens: CENS 57 | limit: LIMIT 58 | colour: pink 59 | size: 2.0 60 | linewidth: 2.0 61 | alpha: 0.9 62 | 63 | NPD_PRED: 64 | ptype: SCATTER 65 | x: PRED 66 | 'y': NPD 67 | labels: 68 | title: NPD vs PRED 69 | subtitle: '' 70 | x: PRED 71 | 'y': NPD 72 | point: 73 | shape: 1.0 74 | colour: black 75 | size: 1.0 76 | is.hline: yes 77 | hline: 78 | colour: black 79 | is.band: yes 80 | is.smooth: yes 81 | smooth: 82 | se: no 83 | colour: red 84 | linetype: 1.0 85 | bloq: 86 | show: yes 87 | cens: CENS 88 | limit: LIMIT 89 | colour: pink 90 | size: 2.0 91 | linewidth: 2.0 92 | alpha: 0.9 93 | 94 | NPD_QQ: 95 | ptype: PMX_QQ 96 | x: NPD 97 | labels: 98 | title: '' 99 | subtitle: '' 100 | x: Standard Normal Quantiles 101 | 'y': NPD Quantiles 102 | is.reference_line: yes 103 | reference_line: 104 | color: black 105 | -------------------------------------------------------------------------------- /inst/rmarkdown/templates/individual/skeleton/skeleton.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | date: "`r format(Sys.time(), '%d %B, %Y')`" 3 | output: 4 | pdf_document: 5 | toc: true 6 | word_document: 7 | toc: true 8 | --- 9 | 10 | --- 11 | params: 12 | ctr: "" 13 | which_pages: ~ 14 | title: ggPMX standing report 15 | --- 16 | 17 | --- 18 | subtitle: `r params$ctr$save_dir ` 19 | title: `r params$title ` 20 | --- 21 | 22 | 23 | ```{r setup, include=FALSE} 24 | knitr::opts_chunk$set(echo = FALSE,message=FALSE) 25 | 26 | ``` 27 | 28 | 29 | # Individual plots 30 | 31 | 32 | ```{r indiv,message=FALSE,fig.align="center",fig.height=10, fig.width=10} 33 | 34 | ctr %>% pmx_plot_individual(which_pages=params$which_pages,print=TRUE) 35 | ``` 36 | 37 | 38 | -------------------------------------------------------------------------------- /inst/rmarkdown/templates/individual/template.yaml: -------------------------------------------------------------------------------- 1 | name: ggPMX_standing_report 2 | description: ggPMX standing report 3 | create_dir: true 4 | -------------------------------------------------------------------------------- /inst/rmarkdown/templates/standing/template.yaml: -------------------------------------------------------------------------------- 1 | name: ggPMX_standing_report 2 | description: ggPMX standing report 3 | create_dir: true 4 | -------------------------------------------------------------------------------- /inst/templates/mlx/standing.ipmx: -------------------------------------------------------------------------------- 1 | predictions : 2 | label : model predictions file 3 | file : predictions.txt 4 | pattern: predictions 5 | reader : read_mlx_pred 6 | names: 7 | ID: id 8 | TIME: time 9 | PRED: poppred 10 | NPDE: npde 11 | IPRED: mlx_ipred 12 | IWRES: mlx_iwres 13 | 14 | estimates : 15 | label : parameter estimates file 16 | file : estimates.txt 17 | reader : read_mlx_par_est 18 | names: 19 | - PARAM 20 | - VALUE 21 | - SE 22 | - RSE 23 | - PVALUE 24 | 25 | eta : 26 | label : invidual estimates of random effects file 27 | file : indiv_eta.txt 28 | reader : read_mlx_ind_est 29 | 30 | 31 | finegrid : 32 | label : finegrid file 33 | file : finegrid.txt 34 | pattern: finegrid 35 | reader : read_mlx_pred 36 | names: 37 | ID: id 38 | TIME: time 39 | PRED: poppred 40 | IPRED: mlx_ipred 41 | -------------------------------------------------------------------------------- /inst/templates/mlx18/standing.ipmx: -------------------------------------------------------------------------------- 1 | sim_blq_y: 2 | label : obsvspred file 3 | subfolder: ChartsData/ObservationsVsPredictions 4 | file : y_obsVsPred.txt 5 | pattern: _obsVsPred 6 | reader : read_mlx18_res 7 | names: 8 | ID: id 9 | TIME: time 10 | y_simBlq_mode: y_simBlq_mode 11 | 12 | sim_blq_npde_iwres: 13 | label : residuals file 14 | subfolder: ChartsData/ScatterPlotOfTheResiduals 15 | file : y_residuals.txt 16 | pattern: _residuals 17 | reader : read_mlx18_res 18 | names: 19 | ID: id 20 | TIME: time 21 | npde_simBlq: npde_simBlq 22 | iwRes_mode_simBlq: iwRes_mode_simBlq 23 | 24 | predictions : 25 | label : model predictions file 26 | file : predictions.txt 27 | pattern: predictions 28 | reader : read_mlx18_pred 29 | names: 30 | ID: id 31 | TIME: time 32 | PRED: poppred 33 | IPRED: mlx18_ipred 34 | IWRES: mlx18_iwres 35 | residuals: 36 | label : residuals file 37 | subfolder: ChartsData/ScatterPlotOfTheResiduals 38 | file : y_residuals.txt 39 | pattern: _residuals 40 | names: 41 | ID: id 42 | TIME: time 43 | NPDE: npde 44 | 45 | eta : 46 | label : invidual estimates of random effects file 47 | subfolder: IndividualParameters 48 | file : estimatedRandomEffects.txt 49 | reader : read_mlx18_ind_est 50 | 51 | 52 | estimates : 53 | label : parameter estimates file 54 | file : populationParameters.txt 55 | reader : read_mlx_par_est 56 | sep: "," 57 | names: 58 | - PARAM 59 | - VALUE 60 | - SE 61 | - RSE 62 | 63 | finegrid : 64 | label : finegrid file 65 | file : y_fits.txt 66 | subfolder: ChartsData/IndividualFits 67 | pattern: _fits 68 | reader : read_mlx18_pred 69 | names: 70 | ID: id 71 | TIME: time 72 | PRED: poppred 73 | IPRED: mlx18_finegrid_ipred 74 | 75 | -------------------------------------------------------------------------------- /inst/templates/mlx18/standing_old.ipmx: -------------------------------------------------------------------------------- 1 | predictions : 2 | label : model predictions file 3 | file : predictions.txt 4 | pattern: predictions 5 | reader : read_mlx18_pred 6 | names: 7 | ID: id 8 | TIME: time 9 | PRED: poppred 10 | IPRED: mlx18_ipred 11 | IWRES: mlx18_iwres 12 | residuals: 13 | label : residuals file 14 | subfolder: ChartsData/ScatterPlotOfTheResiduals 15 | file : y_residuals.txt 16 | pattern: _residuals 17 | names: 18 | ID: id 19 | TIME: time 20 | NPDE: npde 21 | 22 | eta : 23 | label : invidual estimates of random effects file 24 | subfolder: IndividualParameters 25 | file : estimatedRandomEffects.txt 26 | reader : read_mlx18_ind_est 27 | 28 | 29 | estimates : 30 | label : parameter estimates file 31 | file : populationParameters.txt 32 | reader : read_mlx_par_est 33 | sep: "," 34 | names: 35 | - PARAM 36 | - VALUE 37 | - SE 38 | - RSE 39 | 40 | finegrid : 41 | label : finegrid file 42 | file : y_fits.txt 43 | subfolder: ChartsData/IndividualFits 44 | pattern: _fits 45 | reader : read_mlx18_pred 46 | names: 47 | ID: id 48 | TIME: time 49 | PRED: poppred 50 | IPRED: mlx18_finegrid_ipred 51 | 52 | -------------------------------------------------------------------------------- /inst/testdata/1_popPK_model/RESULTS/estimates.txt: -------------------------------------------------------------------------------- 1 | ; parameter; s.e._lin;r.s.e._lin;pvalues_lin 2 | F_pop; 0.30741; 0.06417; 20.87; NaN 3 | beta_F_ILOW_1; 0.00000; NaN; NaN; NaN 4 | beta_F_ILOW_2; 0.73168; 0.34554; 47.23; 0.034217 5 | beta_F_OCC_1; 0.00000; NaN; NaN; NaN 6 | beta_F_OCC_2; 0.39844; 0.15243; 38.26; 0.0089497 7 | CL_pop; 0.71938; 0.03212; 4.47; NaN 8 | Vc_pop; 3.42074; 0.14598; 4.27; NaN 9 | Q1_pop; 0.40524; 0.02497; 6.16; NaN 10 | Vp1_pop; 2.90321; 0.13124; 4.52; NaN 11 | ka_input2_pop; 0.26678; 0.01798; 6.74; NaN 12 | Tlag_input2_pop; 0.00000; 0.00000; 0.00; NaN 13 | omega_F; 0.58835; 0.13606; 23.13; NaN 14 | omega_CL; 0.28985; 0.01851; 6.39; NaN 15 | omega_Vc; 0.23675; 0.02833; 11.97; NaN 16 | omega_Q1; 0.00000; 0.00000; 0.00; NaN 17 | omega_Vp1; 0.15945; 0.03369; 21.13; NaN 18 | omega_ka_input2; 0.00000; 0.00000; 0.00; NaN 19 | omega_Tlag_input2; 0.00000; 0.00000; 0.00; NaN 20 | gamma_F; 0.32521; 0.09054; 27.84; NaN 21 | gamma_CL; 0.00000; 0.00000; 0.00; NaN 22 | gamma_Vc; 0.00000; 0.00000; 0.00; NaN 23 | gamma_Q1; 0.00000; 0.00000; 0.00; NaN 24 | gamma_Vp1; 0.00000; 0.00000; 0.00; NaN 25 | gamma_ka_input2; 0.00000; 0.00000; 0.00; NaN 26 | gamma_Tlag_input2; 0.00000; 0.00000; 0.00; NaN 27 | a; 29.92288; 3.88990; 13.00; NaN 28 | b; 0.15724; 0.00719; 4.57; NaN 29 | -------------------------------------------------------------------------------- /inst/testdata/extdata/run001.mod: -------------------------------------------------------------------------------- 1 | ;; 1. Based on: 000 2 | ;; 2. Description: 3 | ;; NONMEM PK example for xpose 4 | $PROBLEM Parameter estimation 5 | $INPUT ID DOSE DV SCR AGE SEX CLASS WT ACE MED1 MED2 TAD TIME 6 | CLCR AMT SS II EVID 7 | $DATA mx19_2.csv IGNORE=@ 8 | $ABBREVIATED DERIV2=NO 9 | $SUBROUTINE ADVAN2 TRANS1 10 | $PK 11 | TVCL = THETA(1)*(1+THETA(7)*(CLCR-65)) 12 | TVV = THETA(2)*WT 13 | CL = TVCL*EXP(ETA(1)) 14 | V = TVV*EXP(ETA(2)) 15 | KA = THETA(3)*EXP(ETA(3)) 16 | ALAG1 = THETA(4) 17 | K = CL/V 18 | 19 | $ERROR 20 | A1 = A(1) 21 | A2 = A(2) 22 | IPRED = A2/V 23 | IRES = IPRED-DV 24 | W = THETA(5)*IPRED + THETA(6) 25 | IWRES = IRES/W 26 | Y = IPRED + W*EPS(1) 27 | 28 | $THETA (0,25.7435) ; TVCL 29 | $THETA (0,1.36688) ; TVV 30 | $THETA (0,7.25257) ; TVKA 31 | $THETA (0,0.215994) ; LAG 32 | $THETA (0,0.215055) ; Prop. Err 33 | $THETA (0,0.0096742) ; Add. Err 34 | $THETA (0,0.00637473,.02941) ; CRCL on CL 35 | $OMEGA 0.0728446 ; IIV CL 36 | $OMEGA 0.0419272 ; IIV V 37 | $OMEGA 2.33689 ; IIV KA 38 | $SIGMA 1 FIX 39 | $ESTIMATION METHOD=1 INTER MAXEVALS=9999 PRINT=1 NOABORT MSFO=msf001 40 | $COVARIANCE PRINT=E 41 | $TABLE ID DOSE AMT SS II TIME TAD IPRED CWRES CPRED IWRES EVID A1 42 | A2 ONEHEADER NOPRINT FILE=sdtab001 ; Simple table 43 | $TABLE ID SEX MED1 MED2 ONEHEADER NOPRINT NOAPPEND 44 | FORMAT=,1PE11.4 FILE=catab001.csv ; Table in csv format 45 | $TABLE ID CLCR AGE WT ONEHEADER FIRSTONLY NOPRINT NOAPPEND 46 | FILE=cotab001 ; Table with firstonly option 47 | $TABLE ID KA CL V ALAG1 ETAS(1:LAST) FIRSTONLY ONEHEADER NOPRINT 48 | NOAPPEND FILE=patab001 ; Table with firstonly option 49 | 50 | ; Problem no. 2 51 | $PROBLEM Model simulations 52 | $INPUT ID DOSE DV SCR AGE SEX CLASS WT ACE MED1 MED2 TAD TIME 53 | CLCR AMT SS II EVID 54 | $DATA mx19_2.csv IGNORE=@ REWIND 55 | $MSFI msf001 56 | $SIMULATION (221287) ONLYSIM NSUB=20 ; Small sim for illustration only 57 | $TABLE ID DV IPRED DOSE AMT TIME TAD EVID SEX CLCR AGE WT 58 | ONEHEADER NOPRINT NOAPPEND FILE=simtab001 ; Simulation table 59 | 60 | -------------------------------------------------------------------------------- /inst/testdata/extdata/run001.shk: -------------------------------------------------------------------------------- 1 | TABLE NO. 1: First Order Conditional Estimation with Interaction: Problem=1 Subproblem=0 Superproblem1=0 Iteration1=0 Superproblem2=0 Iteration2=0 2 | TYPE SUBPOP ETA(1) ETA(2) ETA(3) 3 | 1 1 1.28890E-02 -2.27124E-02 -2.52710E-01 4 | 2 1 2.82760E-02 1.60484E-02 1.21733E-01 5 | 3 1 6.48513E-01 1.56996E-01 3.79001E-02 6 | 4 1 9.32892E+00 2.87148E+01 2.36508E+01 7 | 5 1 1.48554E+01 0.00000E+00 0.00000E+00 8 | 6 1 8.22660E+00 2.85317E+01 2.12383E+01 9 | 7 1 7.40000E+01 7.40000E+01 7.40000E+01 10 | -------------------------------------------------------------------------------- /inst/testdata/extdata/simtab001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/inst/testdata/extdata/simtab001.zip -------------------------------------------------------------------------------- /inst/testdata/pk_pd/RESULTS/estimates.txt: -------------------------------------------------------------------------------- 1 | ; parameter; s.e._lin;r.s.e._lin;pvalues_lin 2 | Tlag_pop; 0.77760; 0.18519; 23.82; NaN 3 | ka_pop; 1.23760; 0.34029; 27.50; NaN 4 | V_pop; 8.07655; 0.22638; 2.80; NaN 5 | beta_V_lw70; 0.89744; 0.14299; 15.93; 3.4649e-10 6 | Cl_pop; 0.13398; 0.00649; 4.84; NaN 7 | beta_Cl_lw70; 0.59439; 0.25703; 43.24; 0.020749 8 | Imax_pop; 0.76271; 0.01226; 1.61; NaN 9 | IC50_pop; 0.18747; 0.05384; 28.72; NaN 10 | S0_pop; 95.17567; 1.53446; 1.61; NaN 11 | omega_Tlag; 0.56595; 0.17734; 31.34; NaN 12 | omega_ka; 0.75578; 0.21979; 29.08; NaN 13 | omega_V; 0.13804; 0.02223; 16.10; NaN 14 | omega_Cl; 0.26743; 0.03468; 12.97; NaN 15 | omega_Imax; 0.09472; 0.11679; 123.30; NaN 16 | omega_IC50; 0.92653; 0.21037; 22.71; NaN 17 | omega_S0; 0.02044; 0.04486; 219.49; NaN 18 | a1; 0.24670; 0.04455; 18.06; NaN 19 | b1; 0.05987; 0.00914; 15.27; NaN 20 | a2; 8.35416; 0.45416; 5.44; NaN 21 | -------------------------------------------------------------------------------- /inst/testdata/pk_pd/pk_pd.mlxtran: -------------------------------------------------------------------------------- 1 | ; this script is generated automatically 2 | 3 | 4 | 5 | [FILEINFO] 6 | file = 'pk_pd.csv' 7 | delimiter = comma 8 | header = {id, time, amt, dv, dvid, wt, sex, age} 9 | 10 | [CONTENT] 11 | id = {use=identifier} 12 | time = {use=time} 13 | amt = {use=amount} 14 | dv = {use=observation, name={abc, d4}, ytype={3, 4}, type={continuous, continuous}} 15 | dvid = {use=observationType} 16 | wt = {use=covariate, type=continuous} 17 | sex = {use=covariate, type=categorical} 18 | 19 | 20 | 21 | [COVARIATE] 22 | input = {wt, sex} 23 | sex = {type=categorical, categories={0, 1}} 24 | 25 | EQUATION: 26 | lw70 = log(wt/70) 27 | 28 | [INDIVIDUAL] 29 | input = {Tlag_pop, omega_Tlag, ka_pop, omega_ka, V_pop, beta_V_lw70, lw70, omega_V, Cl_pop, beta_Cl_lw70, omega_Cl, Imax_pop, omega_Imax, IC50_pop, omega_IC50, S0_pop, omega_S0} 30 | 31 | DEFINITION: 32 | Tlag = {distribution=lognormal, typical=Tlag_pop, sd=omega_Tlag} 33 | ka = {distribution=lognormal, typical=ka_pop, sd=omega_ka} 34 | V = {distribution=lognormal, typical=V_pop, covariate=lw70, coefficient=beta_V_lw70, sd=omega_V} 35 | Cl = {distribution=lognormal, typical=Cl_pop, covariate=lw70, coefficient=beta_Cl_lw70, sd=omega_Cl} 36 | Imax = {distribution=logitnormal, typical=Imax_pop, sd=omega_Imax} 37 | IC50 = {distribution=lognormal, typical=IC50_pop, sd=omega_IC50} 38 | S0 = {distribution=lognormal, typical=S0_pop, sd=omega_S0} 39 | 40 | [LONGITUDINAL] 41 | input = {a1, b1, a2} 42 | 43 | file = './immediateResponse_model.txt' 44 | 45 | DEFINITION: 46 | abc = {distribution=normal, prediction=Cc, errorModel=combined1(a1, b1)} 47 | 48 | d4 = {distribution=normal, prediction=E, errorModel=constant(a2)} 49 | 50 | 51 | data = {abc, d4} 52 | model = {abc, d4} 53 | 54 | 55 | Tlag_pop = {value=1, method=MLE} 56 | omega_Tlag = {value=1, method=MLE} 57 | ka_pop = {value=1, method=MLE} 58 | omega_ka = {value=1, method=MLE} 59 | V_pop = {value=10, method=MLE} 60 | beta_V_lw70 = {value=0, method=MLE} 61 | omega_V = {value=1, method=MLE} 62 | Cl_pop = {value=0.1, method=MLE} 63 | beta_Cl_lw70 = {value=0, method=MLE} 64 | omega_Cl = {value=1, method=MLE} 65 | Imax_pop = {value=0.5, method=MLE} 66 | omega_Imax = {value=1, method=MLE} 67 | IC50_pop = {value=1, method=MLE} 68 | omega_IC50 = {value=1, method=MLE} 69 | S0_pop = {value=1, method=MLE} 70 | omega_S0 = {value=1, method=MLE} 71 | a1 = {value=0.3, method=MLE} 72 | b1 = {value=0.1, method=MLE} 73 | a2 = {value=1, method=MLE} 74 | 75 | 76 | 77 | [TASKS] 78 | populationParameters() 79 | individualParameters(method = conditionalMode) 80 | fim(method = Linearization) 81 | plotResult() 82 | 83 | [SETTINGS] 84 | GLOBAL: 85 | exportpath = 'RESULTS' 86 | nbchains = 2 87 | autochains = no 88 | 89 | -------------------------------------------------------------------------------- /inst/testdata/theophylline/Monolix/estimates.txt: -------------------------------------------------------------------------------- 1 | ; parameter; s.e._lin;r.s.e._lin;pvalues_lin 2 | ka_pop; 0.28854; 0.02110; 7.31; NaN 3 | V_pop; 2.28602; 0.12884; 5.64; NaN 4 | beta_V_tWT0; 0.18140; 0.13391; 73.82; 0.17552 5 | Cl_pop; 0.31399; 0.02596; 8.27; NaN 6 | beta_Cl_tWT0; -0.16148; 0.21977; 136.09; 0.46247 7 | beta_Cl_tAGE0; -0.05719; 0.08021; 140.27; 0.47589 8 | beta_Cl_SEX_0; 0.00000; NaN; NaN; NaN 9 | beta_Cl_SEX_1; -0.10060; 0.07866; 78.18; 0.20089 10 | beta_Cl_STUD_1; 0.00000; NaN; NaN; NaN 11 | beta_Cl_STUD_2; 0.12207; 0.07197; 58.96; 0.089852 12 | omega_ka; 0.10024; 0.07473; 74.55; NaN 13 | omega_V; 0.03939; 0.11026; 279.91; NaN 14 | omega_Cl; 0.22485; 0.02578; 11.46; NaN 15 | b; 0.28986; 0.00968; 3.34; NaN 16 | -------------------------------------------------------------------------------- /man/abbrev.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{abbrev} 4 | \alias{abbrev} 5 | \title{Give the whole abbreviation definition} 6 | \usage{ 7 | abbrev(param) 8 | } 9 | \arguments{ 10 | \item{param}{abbreviation term} 11 | } 12 | \value{ 13 | character abbreviation definition 14 | } 15 | \description{ 16 | Give the whole abbreviation definition 17 | } 18 | \examples{ 19 | abbrev("VPC") 20 | } 21 | -------------------------------------------------------------------------------- /man/add_draft.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{add_draft} 4 | \alias{add_draft} 5 | \title{Add draft layer annotation} 6 | \usage{ 7 | add_draft( 8 | label = "DRAFT", 9 | size = 10, 10 | colour = "grey50", 11 | x = Inf, 12 | y = -Inf, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{label}{draft layer default to DRAFT} 18 | 19 | \item{size}{size of the annotation} 20 | 21 | \item{colour}{color of the annotation default to grey50} 22 | 23 | \item{x}{\code{numeric} x coordinate of the draft label} 24 | 25 | \item{y}{\code{numeric} y coordinate of the draft label} 26 | 27 | \item{...}{extra parameters to geom text used to annotate the draft} 28 | } 29 | \value{ 30 | ggplot2 annotation 31 | } 32 | \description{ 33 | This function adds the word draft to certain graphics. 34 | } 35 | -------------------------------------------------------------------------------- /man/check_shrink.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{check_shrink} 4 | \alias{check_shrink} 5 | \title{Performs checks of names in shrink list} 6 | \usage{ 7 | check_shrink(shrink_list) 8 | } 9 | \arguments{ 10 | \item{shrink_list}{\code{list} list of shrink arguments} 11 | } 12 | \description{ 13 | Performs checks of names in shrink list 14 | } 15 | -------------------------------------------------------------------------------- /man/distrib.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-distribution.R 3 | \name{distrib} 4 | \alias{distrib} 5 | \title{creates a graphic distribution object} 6 | \usage{ 7 | distrib( 8 | labels, 9 | is.shrink, 10 | type = c("box", "hist"), 11 | is.jitter = FALSE, 12 | jitter = NULL, 13 | facets = NULL, 14 | histogram = NULL, 15 | shrink = NULL, 16 | dname = NULL, 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{labels}{list of texts/titles used within the plot} 22 | 23 | \item{is.shrink}{\code{logical} if TRUE add shrinkage layer} 24 | 25 | \item{type}{box for boxplot or histogram} 26 | 27 | \item{is.jitter}{\code{logical} if TRUE add jitter operator for points} 28 | 29 | \item{jitter}{list set jitter parameter} 30 | 31 | \item{facets}{list set the facet setting in case of histogram plot} 32 | 33 | \item{histogram}{\code{list} histogram graphical parameters} 34 | 35 | \item{shrink}{\code{pmxShrinkClass} shrinkage graphical parameter or 36 | \code{list} coercible into one} 37 | 38 | \item{dname}{name of dataset to be used} 39 | 40 | \item{...}{others graphics arguments passed to \code{\link{pmx_gpar}} internal object.} 41 | } 42 | \value{ 43 | distrib object 44 | } 45 | \description{ 46 | creates a graphic distribution object 47 | } 48 | \details{ 49 | \strong{labels} is a list that contains: 50 | \itemize{ 51 | \item \strong{title:} plot title default "EBE distribution" 52 | \item \strong{subtitle:} plot subtitle default empty 53 | \item \strong{x:} x axis label default to "Etas" 54 | \item \strong{y:} y axis label default to empty 55 | \item \strong{legend:} legend title default to "random Effect" 56 | } 57 | \strong{shrink} is a list that contains: 58 | \itemize{ 59 | \item \strong{fun:} shrinkage function can be \code{sd} or \code{var} 60 | \item \strong{size:} shrinkage text size 61 | \item \strong{color:} shrinkage text color 62 | \item \strong{vjust:} shrinkage position vertical adjustment 63 | } 64 | } 65 | \seealso{ 66 | Other plot_pmx: 67 | \code{\link{eta_cov}()}, 68 | \code{\link{eta_pairs}()}, 69 | \code{\link{individual}()}, 70 | \code{\link{plot_pmx.distrib}()}, 71 | \code{\link{plot_pmx.eta_cov}()}, 72 | \code{\link{plot_pmx.eta_pairs}()}, 73 | \code{\link{plot_pmx.individual}()}, 74 | \code{\link{plot_pmx.pmx_dens}()}, 75 | \code{\link{plot_pmx.pmx_gpar}()}, 76 | \code{\link{plot_pmx.pmx_qq}()}, 77 | \code{\link{plot_pmx.residual}()}, 78 | \code{\link{plot_pmx}()} 79 | } 80 | \concept{plot_pmx} 81 | -------------------------------------------------------------------------------- /man/eta_cov.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-eta-cov.R 3 | \name{eta_cov} 4 | \alias{eta_cov} 5 | \title{This creates an ETA covariance matrix which can be used to define the co-relation between the parameters and 6 | its shrinkage..} 7 | \usage{ 8 | eta_cov( 9 | labels, 10 | type = c("cats", "conts"), 11 | dname = NULL, 12 | show.correl = TRUE, 13 | correl = NULL, 14 | facets = NULL, 15 | point = NULL, 16 | covariates = NULL, 17 | is.strat.color = FALSE, 18 | ... 19 | ) 20 | } 21 | \arguments{ 22 | \item{labels}{list of texts/titles used within the plot} 23 | 24 | \item{type}{box for cats or conts} 25 | 26 | \item{dname}{name of dataset to be used} 27 | 28 | \item{show.correl}{\code{logical} if TRUE add correlation to the plot} 29 | 30 | \item{correl}{\code{list} correl geom text graphical parameter} 31 | 32 | \item{facets}{\code{list} facetting graphical parameter} 33 | 34 | \item{point}{\code{list} geom point graphical parameter} 35 | 36 | \item{covariates}{\code{pmxCOVObject} \code{\link{pmx_cov}}} 37 | 38 | \item{is.strat.color}{\code{logical} if `TRUE` use a different color for the spline stratification.} 39 | 40 | \item{...}{others graphics arguments passed to \code{\link{pmx_gpar}} internal object.} 41 | } 42 | \value{ 43 | \code{eta_cov} object 44 | } 45 | \description{ 46 | This creates an ETA covariance matrix which can be used to define the co-relation between the parameters and 47 | its shrinkage.. 48 | } 49 | \details{ 50 | \strong{labels} is a list that contains: 51 | \itemize{ 52 | \item \strong{title:} plot title default "EBE vs. covariates" 53 | \item \strong{x:} x axis label default to "Etas" 54 | \item \strong{y:} y axis label default to empty 55 | } 56 | } 57 | \seealso{ 58 | Other plot_pmx: 59 | \code{\link{distrib}()}, 60 | \code{\link{eta_pairs}()}, 61 | \code{\link{individual}()}, 62 | \code{\link{plot_pmx.distrib}()}, 63 | \code{\link{plot_pmx.eta_cov}()}, 64 | \code{\link{plot_pmx.eta_pairs}()}, 65 | \code{\link{plot_pmx.individual}()}, 66 | \code{\link{plot_pmx.pmx_dens}()}, 67 | \code{\link{plot_pmx.pmx_gpar}()}, 68 | \code{\link{plot_pmx.pmx_qq}()}, 69 | \code{\link{plot_pmx.residual}()}, 70 | \code{\link{plot_pmx}()} 71 | } 72 | \concept{plot_pmx} 73 | -------------------------------------------------------------------------------- /man/eta_pairs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-eta-pairs.R 3 | \name{eta_pairs} 4 | \alias{eta_pairs} 5 | \title{This creates an eta correlation which defines the relationship between parameters} 6 | \usage{ 7 | eta_pairs( 8 | is.title, 9 | title, 10 | dname = NULL, 11 | type.eta = c("mode", "mean"), 12 | text_color = "black", 13 | is.shrink = TRUE, 14 | is.smooth = TRUE, 15 | smooth = NULL, 16 | point = NULL, 17 | shrink = NULL, 18 | is.hline = FALSE, 19 | hline = NULL, 20 | is.vreference_line = FALSE, 21 | vreference_line = list(colour = "orange", linetype = "longdash"), 22 | ... 23 | ) 24 | } 25 | \arguments{ 26 | \item{is.title}{\code{logical} if TRUE then a title is used for the plot} 27 | 28 | \item{title}{character the plot title} 29 | 30 | \item{dname}{name of dataset to be used} 31 | 32 | \item{type.eta}{\code{character} type of eat can be 'mode' or 'mean'.'mode' by default} 33 | 34 | \item{text_color}{color of the correlation text in the upper matrix} 35 | 36 | \item{is.shrink}{\code{logical} if TRUE add shrinkage to the plot} 37 | 38 | \item{is.smooth}{\code{logical} if TRUE add smoothing to lower matrix plots} 39 | 40 | \item{smooth}{\code{list} geom_smooth graphical parameters} 41 | 42 | \item{point}{\code{list} geom_point graphical parameter} 43 | 44 | \item{shrink}{\code{pmxShrinkClass} shrinkage graphical parameter or 45 | \code{list} coercible into one} 46 | 47 | \item{is.hline}{\code{logical} if TRUE add horizontal line to lower matrix plots} 48 | 49 | \item{hline}{\code{list} geom_hline graphical parameters} 50 | 51 | \item{is.vreference_line}{\code{logical} if TRUE add the +- 1.96 lines} 52 | 53 | \item{vreference_line}{\code{list} geom_hline graphical parameters for the reference lines} 54 | 55 | \item{...}{others graphics arguments passed to \code{\link{pmx_gpar}} internal object.} 56 | } 57 | \value{ 58 | ecorrel object 59 | } 60 | \description{ 61 | This creates an eta correlation which defines the relationship between parameters 62 | } 63 | \seealso{ 64 | Other plot_pmx: 65 | \code{\link{distrib}()}, 66 | \code{\link{eta_cov}()}, 67 | \code{\link{individual}()}, 68 | \code{\link{plot_pmx.distrib}()}, 69 | \code{\link{plot_pmx.eta_cov}()}, 70 | \code{\link{plot_pmx.eta_pairs}()}, 71 | \code{\link{plot_pmx.individual}()}, 72 | \code{\link{plot_pmx.pmx_dens}()}, 73 | \code{\link{plot_pmx.pmx_gpar}()}, 74 | \code{\link{plot_pmx.pmx_qq}()}, 75 | \code{\link{plot_pmx.residual}()}, 76 | \code{\link{plot_pmx}()} 77 | } 78 | \concept{plot_pmx} 79 | -------------------------------------------------------------------------------- /man/eval_sym_parent_env.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-all-plots.R 3 | \name{eval_sym_parent_env} 4 | \alias{eval_sym_parent_env} 5 | \title{Try to evaluate a symbol in the parent frame (on errorr eturn the symbol)} 6 | \usage{ 7 | eval_sym_parent_env(x) 8 | } 9 | \arguments{ 10 | \item{x}{any object} 11 | } 12 | \description{ 13 | Try to evaluate a symbol in the parent frame (on errorr eturn the symbol) 14 | } 15 | -------------------------------------------------------------------------------- /man/figures/README-example-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-example-1.png -------------------------------------------------------------------------------- /man/figures/README-illustrate_diagnostic-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-illustrate_diagnostic-1.png -------------------------------------------------------------------------------- /man/figures/README-illustrate_diagnostic-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-illustrate_diagnostic-2.png -------------------------------------------------------------------------------- /man/figures/README-illustrate_diagnostic-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-illustrate_diagnostic-3.png -------------------------------------------------------------------------------- /man/figures/README-illustrate_diagnostic-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-illustrate_diagnostic-4.png -------------------------------------------------------------------------------- /man/figures/README-illustrate_diagnostic-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-illustrate_diagnostic-5.png -------------------------------------------------------------------------------- /man/figures/README-settings_cat_labels-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-settings_cat_labels-1.png -------------------------------------------------------------------------------- /man/figures/README-settings_cat_labels2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-settings_cat_labels2-1.png -------------------------------------------------------------------------------- /man/figures/README-settings_cat_labels3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-settings_cat_labels3-1.png -------------------------------------------------------------------------------- /man/figures/README-settings_color_scales_local-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-settings_color_scales_local-1.png -------------------------------------------------------------------------------- /man/figures/README-settings_solor_scales-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-settings_solor_scales-1.png -------------------------------------------------------------------------------- /man/figures/README-settings_solor_scales_a-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-settings_solor_scales_a-1.png -------------------------------------------------------------------------------- /man/figures/README-settings_use.abbrev-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-settings_use.abbrev-1.png -------------------------------------------------------------------------------- /man/figures/README-settings_use.finegrid-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-settings_use.finegrid-1.png -------------------------------------------------------------------------------- /man/figures/README-shrink_plot_box-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-shrink_plot_box-1.png -------------------------------------------------------------------------------- /man/figures/README-shrink_plot_hist-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-shrink_plot_hist-1.png -------------------------------------------------------------------------------- /man/figures/README-shrink_plot_no-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-shrink_plot_no-1.png -------------------------------------------------------------------------------- /man/figures/README-shrink_plot_strat-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-shrink_plot_strat-1.png -------------------------------------------------------------------------------- /man/figures/README-shrink_plot_var-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-shrink_plot_var-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-14-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-14-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-16-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-16-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-17-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-17-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-18-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-18-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-19-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-19-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-20-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-20-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-26-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-26-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-27-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-27-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-28-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-28-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-29-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-29-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-30-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-30-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-31-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-31-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-41-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-41-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-45-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/README-unnamed-chunk-45-1.png -------------------------------------------------------------------------------- /man/figures/ggPMX_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/ggPMX_arch.png -------------------------------------------------------------------------------- /man/figures/ggPMX_cheat_sheet_0_9_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/ggPMX_cheat_sheet_0_9_4.png -------------------------------------------------------------------------------- /man/figures/ggpmx_example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/ggpmx_example1.png -------------------------------------------------------------------------------- /man/figures/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/man/figures/logo.jpg -------------------------------------------------------------------------------- /man/getPmxOption.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggPMX-options.R 3 | \name{getPmxOption} 4 | \alias{getPmxOption} 5 | \title{Get ggPMX Option} 6 | \usage{ 7 | getPmxOption(name, default = NULL) 8 | } 9 | \arguments{ 10 | \item{name}{Name of an option to get.} 11 | 12 | \item{default}{Value to be returned if the option is not currently set.} 13 | } 14 | \description{ 15 | Get ggPMX Option 16 | } 17 | \examples{ 18 | \dontrun{ 19 | pmxOptions(myOption = 10) 20 | getPmxOption("myOption") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /man/get_abbrev.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{get_abbrev} 4 | \alias{get_abbrev} 5 | \title{Get abbreviation definition by key} 6 | \usage{ 7 | get_abbrev(ctr, param) 8 | } 9 | \arguments{ 10 | \item{ctr}{\code{pmxClass} controller} 11 | 12 | \item{param}{abbreviation term} 13 | } 14 | \value{ 15 | \code{character} abbreviation definition 16 | } 17 | \description{ 18 | Get abbreviation definition by key 19 | } 20 | -------------------------------------------------------------------------------- /man/get_cats.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{get_cats} 4 | \alias{get_cats} 5 | \title{Get category covariates} 6 | \usage{ 7 | get_cats(ctr) 8 | } 9 | \arguments{ 10 | \item{ctr}{the controller object} 11 | } 12 | \value{ 13 | a charcater vector 14 | } 15 | \description{ 16 | Get category covariates 17 | } 18 | \seealso{ 19 | Other pmxclass: 20 | \code{\link{get_conts}()}, 21 | \code{\link{get_covariates}()}, 22 | \code{\link{get_data}()}, 23 | \code{\link{get_occ}()}, 24 | \code{\link{get_plot_config}()}, 25 | \code{\link{get_plot}()}, 26 | \code{\link{get_strats}()}, 27 | \code{\link{plot_names}()}, 28 | \code{\link{plots}()}, 29 | \code{\link{pmx_update}()}, 30 | \code{\link{set_data}()}, 31 | \code{\link{set_plot}()} 32 | } 33 | \concept{pmxclass} 34 | -------------------------------------------------------------------------------- /man/get_conts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{get_conts} 4 | \alias{get_conts} 5 | \title{Get continuous covariates} 6 | \usage{ 7 | get_conts(ctr) 8 | } 9 | \arguments{ 10 | \item{ctr}{the controller object} 11 | } 12 | \value{ 13 | a charcater vector 14 | } 15 | \description{ 16 | Get continuous covariates 17 | } 18 | \seealso{ 19 | Other pmxclass: 20 | \code{\link{get_cats}()}, 21 | \code{\link{get_covariates}()}, 22 | \code{\link{get_data}()}, 23 | \code{\link{get_occ}()}, 24 | \code{\link{get_plot_config}()}, 25 | \code{\link{get_plot}()}, 26 | \code{\link{get_strats}()}, 27 | \code{\link{plot_names}()}, 28 | \code{\link{plots}()}, 29 | \code{\link{pmx_update}()}, 30 | \code{\link{set_data}()}, 31 | \code{\link{set_plot}()} 32 | } 33 | \concept{pmxclass} 34 | -------------------------------------------------------------------------------- /man/get_covariates.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{get_covariates} 4 | \alias{get_covariates} 5 | \title{Get covariates variables} 6 | \usage{ 7 | get_covariates(ctr) 8 | } 9 | \arguments{ 10 | \item{ctr}{the controller object} 11 | } 12 | \value{ 13 | a charcater vector 14 | } 15 | \description{ 16 | Get covariates variables 17 | } 18 | \seealso{ 19 | Other pmxclass: 20 | \code{\link{get_cats}()}, 21 | \code{\link{get_conts}()}, 22 | \code{\link{get_data}()}, 23 | \code{\link{get_occ}()}, 24 | \code{\link{get_plot_config}()}, 25 | \code{\link{get_plot}()}, 26 | \code{\link{get_strats}()}, 27 | \code{\link{plot_names}()}, 28 | \code{\link{plots}()}, 29 | \code{\link{pmx_update}()}, 30 | \code{\link{set_data}()}, 31 | \code{\link{set_plot}()} 32 | } 33 | \concept{pmxclass} 34 | -------------------------------------------------------------------------------- /man/get_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{get_data} 4 | \alias{get_data} 5 | \title{Get controller data set} 6 | \usage{ 7 | get_data( 8 | ctr, 9 | data_set = c("estimates", "predictions", "eta", "finegrid", "input", "sim", 10 | "individual") 11 | ) 12 | } 13 | \arguments{ 14 | \item{ctr}{the controller object} 15 | 16 | \item{data_set}{the data set name} 17 | } 18 | \value{ 19 | a data.table of the named data set if available. 20 | } 21 | \description{ 22 | Get controller data set 23 | } 24 | \seealso{ 25 | Other pmxclass: 26 | \code{\link{get_cats}()}, 27 | \code{\link{get_conts}()}, 28 | \code{\link{get_covariates}()}, 29 | \code{\link{get_occ}()}, 30 | \code{\link{get_plot_config}()}, 31 | \code{\link{get_plot}()}, 32 | \code{\link{get_strats}()}, 33 | \code{\link{plot_names}()}, 34 | \code{\link{plots}()}, 35 | \code{\link{pmx_update}()}, 36 | \code{\link{set_data}()}, 37 | \code{\link{set_plot}()} 38 | } 39 | \concept{pmxclass} 40 | -------------------------------------------------------------------------------- /man/get_occ.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{get_occ} 4 | \alias{get_occ} 5 | \title{Get controller occasional covariates} 6 | \usage{ 7 | get_occ(ctr) 8 | } 9 | \arguments{ 10 | \item{ctr}{the controller object} 11 | } 12 | \value{ 13 | a charcater vector 14 | } 15 | \description{ 16 | Get controller occasional covariates 17 | } 18 | \seealso{ 19 | Other pmxclass: 20 | \code{\link{get_cats}()}, 21 | \code{\link{get_conts}()}, 22 | \code{\link{get_covariates}()}, 23 | \code{\link{get_data}()}, 24 | \code{\link{get_plot_config}()}, 25 | \code{\link{get_plot}()}, 26 | \code{\link{get_strats}()}, 27 | \code{\link{plot_names}()}, 28 | \code{\link{plots}()}, 29 | \code{\link{pmx_update}()}, 30 | \code{\link{set_data}()}, 31 | \code{\link{set_plot}()} 32 | } 33 | \concept{pmxclass} 34 | -------------------------------------------------------------------------------- /man/get_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{get_plot} 4 | \alias{get_plot} 5 | \title{Get plot object} 6 | \usage{ 7 | get_plot(ctr, nplot, which_pages = "all") 8 | } 9 | \arguments{ 10 | \item{ctr}{\code{pmxClass} controller object} 11 | 12 | \item{nplot}{character the plot name} 13 | 14 | \item{which_pages}{integer vector (can be length 1), set page number in case of multi pages plot, or character "all" to plot all pages.} 15 | } 16 | \value{ 17 | ggplot object 18 | } 19 | \description{ 20 | Get plot object 21 | } 22 | \examples{ 23 | \donttest{ 24 | library(ggPMX) 25 | ctr <- theophylline() 26 | p1 <- ctr \%>\% get_plot("iwres_ipred") 27 | ## get all pages or some pages 28 | p2 <- ctr \%>\% get_plot("individual") 29 | ## returns one page of individual plot 30 | p2 <- ctr \%>\% get_plot("individual", which_pages = 1) 31 | p3 <- ctr \%>\% get_plot("individual", which_pages = c(1, 3)) 32 | ## get distribution plot 33 | pdistri <- ctr \%>\% get_plot("eta_hist") 34 | } 35 | 36 | } 37 | \seealso{ 38 | Other pmxclass: 39 | \code{\link{get_cats}()}, 40 | \code{\link{get_conts}()}, 41 | \code{\link{get_covariates}()}, 42 | \code{\link{get_data}()}, 43 | \code{\link{get_occ}()}, 44 | \code{\link{get_plot_config}()}, 45 | \code{\link{get_strats}()}, 46 | \code{\link{plot_names}()}, 47 | \code{\link{plots}()}, 48 | \code{\link{pmx_update}()}, 49 | \code{\link{set_data}()}, 50 | \code{\link{set_plot}()} 51 | } 52 | \concept{pmxclass} 53 | -------------------------------------------------------------------------------- /man/get_plot_config.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{get_plot_config} 4 | \alias{get_plot_config} 5 | \title{Get the plot config by name} 6 | \usage{ 7 | get_plot_config(ctr, pname) 8 | } 9 | \arguments{ 10 | \item{ctr}{the controller object} 11 | 12 | \item{pname}{the plot name} 13 | } 14 | \value{ 15 | the config object 16 | } 17 | \description{ 18 | Get the plot config by name 19 | } 20 | \examples{ 21 | \donttest{ 22 | ctr <- theophylline() 23 | ctr \%>\% set_plot("IND", pname = "indiv1") 24 | ctr \%>\% get_plot_config("distr1") 25 | } 26 | } 27 | \seealso{ 28 | Other pmxclass: 29 | \code{\link{get_cats}()}, 30 | \code{\link{get_conts}()}, 31 | \code{\link{get_covariates}()}, 32 | \code{\link{get_data}()}, 33 | \code{\link{get_occ}()}, 34 | \code{\link{get_plot}()}, 35 | \code{\link{get_strats}()}, 36 | \code{\link{plot_names}()}, 37 | \code{\link{plots}()}, 38 | \code{\link{pmx_update}()}, 39 | \code{\link{set_data}()}, 40 | \code{\link{set_plot}()} 41 | } 42 | \concept{pmxclass} 43 | -------------------------------------------------------------------------------- /man/get_strats.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{get_strats} 4 | \alias{get_strats} 5 | \title{Get extra stratification variables} 6 | \usage{ 7 | get_strats(ctr) 8 | } 9 | \arguments{ 10 | \item{ctr}{the controller object} 11 | } 12 | \value{ 13 | a charcater vector 14 | } 15 | \description{ 16 | Get extra stratification variables 17 | } 18 | \seealso{ 19 | Other pmxclass: 20 | \code{\link{get_cats}()}, 21 | \code{\link{get_conts}()}, 22 | \code{\link{get_covariates}()}, 23 | \code{\link{get_data}()}, 24 | \code{\link{get_occ}()}, 25 | \code{\link{get_plot_config}()}, 26 | \code{\link{get_plot}()}, 27 | \code{\link{plot_names}()}, 28 | \code{\link{plots}()}, 29 | \code{\link{pmx_update}()}, 30 | \code{\link{set_data}()}, 31 | \code{\link{set_plot}()} 32 | } 33 | \concept{pmxclass} 34 | -------------------------------------------------------------------------------- /man/ggPMX.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggPMX-package.R 3 | \docType{package} 4 | \name{ggPMX} 5 | \alias{ggPMX} 6 | \alias{ggPMX-package} 7 | \title{ggPMX: A ggplot2 toolbox for Nonlinear Mixed-Effect Model graphical} 8 | \description{ 9 | This package aims to generate diagnostic plots in a standard way. The tool reads data 10 | from many sources (MONOLIX,NONMEM,others) and generates standard grahics 11 | that can be easily integrated in a single report. 12 | } 13 | \details{ 14 | \itemize{ 15 | \item Get data from different system and create a data source 16 | \item Plot many plots using the generic plot method \code{\link{plot_pmx}}. 17 | } 18 | 19 | For support, feedback or bug reports, please reach out to 20 | \email{ggPMX_ORG@dl.mgd.novartis.com}. 21 | } 22 | \section{Version History}{ 23 | 24 | 25 | \describe{ 26 | 27 | \item{Jan 11 2017, 0.0.0}{Init ggPMX from Novartis rtemplate.} 28 | \item{Feb 06 2017, 0.3.0}{Import version 0.3.0 of package.} 29 | 30 | } 31 | } 32 | 33 | \seealso{ 34 | Useful links: 35 | \itemize{ 36 | \item \url{https://github.com/ggPMXdevelopment/ggPMX} 37 | \item Report bugs at \url{https://github.com/ggPMXdevelopment/ggPMX/issues} 38 | } 39 | 40 | } 41 | \author{ 42 | \strong{Maintainer}: Matthew Fidler \email{matt.fidler@novartis.com} (\href{https://orcid.org/0000-0001-8538-6691}{ORCID}) 43 | 44 | Authors: 45 | \itemize{ 46 | \item Amine Gassem \email{contact@ag-study.com} 47 | \item Bruno Bieth \email{biethb@hotmail.com} 48 | \item Irina Baltcheva \email{irina.baltcheva@gmail.com} 49 | \item Thomas Dumortier \email{ thomas.dumortier@novartis.com} 50 | \item Christian Bartels \email{christian.bartels@novartis.com} 51 | \item Souvik Bhattacharya \email{souvik.bhattacharya@novartis.com} 52 | \item Inga Ludwig \email{inga.ludwig@novartis.com} 53 | \item Ines Paule \email{ines.paule@novartis.com} 54 | \item Didier Renard \email{didier.renard@novartis.com} 55 | \item Seid Hamzic \email{se.hamzic@gmail.com} 56 | } 57 | 58 | Other contributors: 59 | \itemize{ 60 | \item Benjamin Guiastrennec \email{guiastrennec@gmail.com} [contributor] 61 | \item Kyle T Baron \email{kyleb@metrumrg.com} (\href{https://orcid.org/0000-0001-7252-5656}{ORCID}) [contributor] 62 | \item Qing Xi Ooi \email{ooi.qingxi@gmail.com} [contributor] 63 | \item Novartis Pharma AG [copyright holder] 64 | } 65 | 66 | } 67 | \keyword{internal} 68 | -------------------------------------------------------------------------------- /man/gtable_remove_grobs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-eta-pairs.R 3 | \name{gtable_remove_grobs} 4 | \alias{gtable_remove_grobs} 5 | \title{Remove named elements from gtable} 6 | \usage{ 7 | gtable_remove_grobs(table, names, ...) 8 | } 9 | \arguments{ 10 | \item{table}{The table from which grobs should be removed} 11 | 12 | \item{names}{A character vector of the grob names (as listed in \code{table$layout}) 13 | that should be removed} 14 | 15 | \item{...}{Other parameters passed through to \code{gtable_filter}.} 16 | } 17 | \description{ 18 | Remove named elements from gtable 19 | } 20 | -------------------------------------------------------------------------------- /man/individual.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-individual.R 3 | \name{individual} 4 | \alias{individual} 5 | \title{This function can be used to obtain individual prediction and compare with observed data and population prediction 6 | for each individual separately} 7 | \usage{ 8 | individual( 9 | labels, 10 | facets = NULL, 11 | dname = NULL, 12 | ipred_line = NULL, 13 | pred_line = NULL, 14 | point = NULL, 15 | bloq = NULL, 16 | is.legend, 17 | use.finegrid, 18 | ... 19 | ) 20 | } 21 | \arguments{ 22 | \item{labels}{plot texts. labels, axis,} 23 | 24 | \item{facets}{list facets settings nrow/ncol} 25 | 26 | \item{dname}{name of dataset to be used} 27 | 28 | \item{ipred_line}{\code{list} some pred line geom properties aesthetics} 29 | 30 | \item{pred_line}{\code{list} some ipred line geom properties aesthetics} 31 | 32 | \item{point}{\code{list} some point geom properties aesthetics} 33 | 34 | \item{bloq}{\code{pmxBLOQ} object created by \code{\link{pmx_bloq}}} 35 | 36 | \item{is.legend}{\code{logical} if TRUE add a legend} 37 | 38 | \item{use.finegrid}{\code{logical} if FALSE use predictions data set} 39 | 40 | \item{...}{others graphics arguments passed to \code{\link{pmx_gpar}} internal object.} 41 | } 42 | \value{ 43 | individual fit object 44 | } 45 | \description{ 46 | This function can be used to obtain individual prediction and compare with observed data and population prediction 47 | for each individual separately 48 | } 49 | \seealso{ 50 | \code{\link{plot_pmx.individual}} 51 | 52 | Other plot_pmx: 53 | \code{\link{distrib}()}, 54 | \code{\link{eta_cov}()}, 55 | \code{\link{eta_pairs}()}, 56 | \code{\link{plot_pmx.distrib}()}, 57 | \code{\link{plot_pmx.eta_cov}()}, 58 | \code{\link{plot_pmx.eta_pairs}()}, 59 | \code{\link{plot_pmx.individual}()}, 60 | \code{\link{plot_pmx.pmx_dens}()}, 61 | \code{\link{plot_pmx.pmx_gpar}()}, 62 | \code{\link{plot_pmx.pmx_qq}()}, 63 | \code{\link{plot_pmx.residual}()}, 64 | \code{\link{plot_pmx}()} 65 | } 66 | \concept{plot_pmx} 67 | -------------------------------------------------------------------------------- /man/input_finegrid.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-post_load.R 3 | \name{input_finegrid} 4 | \alias{input_finegrid} 5 | \title{Merge input and fingrid data sets} 6 | \usage{ 7 | input_finegrid(input, finegrid) 8 | } 9 | \arguments{ 10 | \item{input}{\code{data.table} input data set} 11 | 12 | \item{finegrid}{\code{data.table} finegrid data set} 13 | } 14 | \value{ 15 | data.table 16 | } 17 | \description{ 18 | Merge input and fingrid data sets 19 | } 20 | -------------------------------------------------------------------------------- /man/is.pmx_gpar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gpar.R 3 | \name{is.pmx_gpar} 4 | \alias{is.pmx_gpar} 5 | \title{Check if an object is a pmx_gpar class} 6 | \usage{ 7 | is.pmx_gpar(x) 8 | } 9 | \arguments{ 10 | \item{x}{pmx_gpar object} 11 | } 12 | \value{ 13 | \code{logical} returns TRUE if it is a \code{pmx_gpar} object 14 | } 15 | \description{ 16 | Check if an object is a pmx_gpar class 17 | } 18 | -------------------------------------------------------------------------------- /man/l_left_join.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{l_left_join} 4 | \alias{l_left_join} 5 | \title{Merge 2 lists} 6 | \usage{ 7 | l_left_join(base_list, overlay_list, recursive = TRUE) 8 | } 9 | \arguments{ 10 | \item{base_list}{list to update} 11 | 12 | \item{overlay_list}{list used to update the first list} 13 | 14 | \item{recursive}{logical if TRUE do the merge in depth} 15 | } 16 | \value{ 17 | list 18 | } 19 | \description{ 20 | left join , the first list is updated by the seond one 21 | } 22 | -------------------------------------------------------------------------------- /man/load_config.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/config.R 3 | \name{load_config} 4 | \alias{load_config} 5 | \title{Obtain the data source config} 6 | \usage{ 7 | load_config(x, sys = c("mlx", "nm", "mlx18")) 8 | } 9 | \arguments{ 10 | \item{x}{the config name.} 11 | 12 | \item{sys}{can be mlx,nm,...} 13 | } 14 | \value{ 15 | a list :data configuration object 16 | } 17 | \description{ 18 | Obtain the data source config 19 | } 20 | -------------------------------------------------------------------------------- /man/load_data_set.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-reader.R 3 | \name{load_data_set} 4 | \alias{load_data_set} 5 | \title{Load data set} 6 | \usage{ 7 | load_data_set(x, path, sys, ...) 8 | } 9 | \arguments{ 10 | \item{x}{data set config} 11 | 12 | \item{path}{character path to the directory} 13 | 14 | \item{sys}{\code{character} mlx or nm} 15 | 16 | \item{...}{extra parameter passed to special readers} 17 | } 18 | \value{ 19 | data.table 20 | } 21 | \description{ 22 | Load data set 23 | } 24 | -------------------------------------------------------------------------------- /man/load_source.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-reader.R 3 | \name{load_source} 4 | \alias{load_source} 5 | \title{Load all/or some source data set} 6 | \usage{ 7 | load_source(sys, path, dconf, ...) 8 | } 9 | \arguments{ 10 | \item{sys}{type cane mlx/nom} 11 | 12 | \item{path}{\code{character} directory path containing all sources.} 13 | 14 | \item{dconf}{configuration object} 15 | 16 | \item{...}{any extra parameters for readers} 17 | } 18 | \value{ 19 | list of data.table 20 | } 21 | \description{ 22 | Load all/or some source data set 23 | } 24 | -------------------------------------------------------------------------------- /man/n_pages.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggforce-facet-paginate.R 3 | \name{n_pages} 4 | \alias{n_pages} 5 | \title{Determine the number of pages in a paginated facet plot} 6 | \usage{ 7 | n_pages(plot) 8 | } 9 | \arguments{ 10 | \item{plot}{A ggplot object using either facet_wrap_paginate or 11 | facet_grid_paginate} 12 | } 13 | \value{ 14 | If the plot uses using either facet_wrap_paginate or 15 | facet_grid_paginate it returns the total number of pages. Otherwise it 16 | returns NULL 17 | } 18 | \description{ 19 | This is a simple helper that returns the number of pages it takes to plot all 20 | panels when using \code{\link{facet_wrap_paginate}} . It partially builds the plot so depending 21 | on the complexity of your plot it might take some time to calculate... 22 | } 23 | -------------------------------------------------------------------------------- /man/param_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/param_table.R 3 | \name{param_table} 4 | \alias{param_table} 5 | \title{Creates parameter kable} 6 | \usage{ 7 | param_table(ctr, fun, return_table = FALSE, scientific = FALSE, digits = 2) 8 | } 9 | \arguments{ 10 | \item{ctr}{Generated controller from e.g. \code{\link{pmx_mlx}} for Monolix.} 11 | 12 | \item{fun}{\code{character} can be "sd" or "var" for shrinkage computation, see \code{\link{pmx_comp_shrink}}} 13 | 14 | \item{return_table}{If TRUE, returns the same table as in get_data('estimates') otherwise it returns a kable} 15 | 16 | \item{scientific}{\code{logical} set to TRUE to get scientific notation of parameter values, or FALSE otherwise} 17 | 18 | \item{digits}{\code{integer} the number of significant digits to use when rounding parameter values} 19 | } 20 | \value{ 21 | Returns a kable with the parameter estimates from get_data('estimates') 22 | } 23 | \description{ 24 | Creates parameter kable 25 | } 26 | \examples{ 27 | #ctr <- theophylline() 28 | #my_params <- ctr \%>\% param_table(fun = "var") 29 | } 30 | -------------------------------------------------------------------------------- /man/parse_mlxtran.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{parse_mlxtran} 4 | \alias{parse_mlxtran} 5 | \title{Parse MONOLIX mlxtran file} 6 | \usage{ 7 | parse_mlxtran(file_name) 8 | } 9 | \arguments{ 10 | \item{file_name}{absolute path to mlxtran file} 11 | } 12 | \value{ 13 | \code{list} key/values to initialize ggPMX controller 14 | } 15 | \description{ 16 | Parse MONOLIX mlxtran file 17 | } 18 | -------------------------------------------------------------------------------- /man/pk_occ.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{pk_occ} 4 | \alias{pk_occ} 5 | \title{Creates pmx controller using monlix data having Occasional variable} 6 | \usage{ 7 | pk_occ() 8 | } 9 | \value{ 10 | pmx controller 11 | } 12 | \description{ 13 | Creates pmx controller using monlix data having Occasional variable 14 | } 15 | \examples{ 16 | \dontrun{ 17 | pk_occ() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /man/pk_pd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{pk_pd} 4 | \alias{pk_pd} 5 | \title{Creates pkpd pmx controller using package internal data} 6 | \usage{ 7 | pk_pd(code = "3") 8 | } 9 | \arguments{ 10 | \item{code}{can be 3 or 4} 11 | } 12 | \description{ 13 | Creates pkpd pmx controller using package internal data 14 | } 15 | -------------------------------------------------------------------------------- /man/plot_names.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{plot_names} 4 | \alias{plot_names} 5 | \title{Get plot names} 6 | \usage{ 7 | plot_names(ctr) 8 | } 9 | \arguments{ 10 | \item{ctr}{\code{pmxClass} controller object} 11 | } 12 | \value{ 13 | list of plot names 14 | } 15 | \description{ 16 | Get plot names 17 | } 18 | \seealso{ 19 | Other pmxclass: 20 | \code{\link{get_cats}()}, 21 | \code{\link{get_conts}()}, 22 | \code{\link{get_covariates}()}, 23 | \code{\link{get_data}()}, 24 | \code{\link{get_occ}()}, 25 | \code{\link{get_plot_config}()}, 26 | \code{\link{get_plot}()}, 27 | \code{\link{get_strats}()}, 28 | \code{\link{plots}()}, 29 | \code{\link{pmx_update}()}, 30 | \code{\link{set_data}()}, 31 | \code{\link{set_plot}()} 32 | } 33 | \concept{pmxclass} 34 | -------------------------------------------------------------------------------- /man/plot_pmx.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generics.R, R/plot-vpc.R 3 | \name{plot_pmx} 4 | \alias{plot_pmx} 5 | \alias{plot_pmx.pmx_vpc} 6 | \title{This is a generic plot method that produces all plots by default described in pmx model 7 | evaluation guidance.} 8 | \usage{ 9 | plot_pmx(x, dx, ...) 10 | 11 | \method{plot_pmx}{pmx_vpc}(x, dx, ...) 12 | } 13 | \arguments{ 14 | \item{x}{object to plot} 15 | 16 | \item{dx}{data.table , plot source data} 17 | 18 | \item{...}{extra argument (not used)} 19 | } 20 | \description{ 21 | This is a generic plot method that produces all plots by default described in pmx model 22 | evaluation guidance. 23 | } 24 | \seealso{ 25 | \code{\link{pmx_gpar}}. 26 | 27 | Other plot_pmx: 28 | \code{\link{distrib}()}, 29 | \code{\link{eta_cov}()}, 30 | \code{\link{eta_pairs}()}, 31 | \code{\link{individual}()}, 32 | \code{\link{plot_pmx.distrib}()}, 33 | \code{\link{plot_pmx.eta_cov}()}, 34 | \code{\link{plot_pmx.eta_pairs}()}, 35 | \code{\link{plot_pmx.individual}()}, 36 | \code{\link{plot_pmx.pmx_dens}()}, 37 | \code{\link{plot_pmx.pmx_gpar}()}, 38 | \code{\link{plot_pmx.pmx_qq}()}, 39 | \code{\link{plot_pmx.residual}()} 40 | } 41 | \concept{plot_pmx} 42 | -------------------------------------------------------------------------------- /man/plot_pmx.distrib.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-distribution.R 3 | \name{plot_pmx.distrib} 4 | \alias{plot_pmx.distrib} 5 | \title{Plot EBE distribution} 6 | \usage{ 7 | \method{plot_pmx}{distrib}(x, dx, ...) 8 | } 9 | \arguments{ 10 | \item{x}{distribution object} 11 | 12 | \item{dx}{data set} 13 | 14 | \item{...}{not used for the moment} 15 | } 16 | \value{ 17 | ggplot2 plot 18 | } 19 | \description{ 20 | Plot EBE distribution 21 | } 22 | \seealso{ 23 | \code{\link{distrib}} 24 | 25 | Other plot_pmx: 26 | \code{\link{distrib}()}, 27 | \code{\link{eta_cov}()}, 28 | \code{\link{eta_pairs}()}, 29 | \code{\link{individual}()}, 30 | \code{\link{plot_pmx.eta_cov}()}, 31 | \code{\link{plot_pmx.eta_pairs}()}, 32 | \code{\link{plot_pmx.individual}()}, 33 | \code{\link{plot_pmx.pmx_dens}()}, 34 | \code{\link{plot_pmx.pmx_gpar}()}, 35 | \code{\link{plot_pmx.pmx_qq}()}, 36 | \code{\link{plot_pmx.residual}()}, 37 | \code{\link{plot_pmx}()} 38 | } 39 | \concept{plot_pmx} 40 | -------------------------------------------------------------------------------- /man/plot_pmx.eta_cov.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-eta-cov.R 3 | \name{plot_pmx.eta_cov} 4 | \alias{plot_pmx.eta_cov} 5 | \title{This plots an ETA covariance matrix which can be used to define the co-relation between the parameters and 6 | its shrinkage} 7 | \usage{ 8 | \method{plot_pmx}{eta_cov}(x, dx, ...) 9 | } 10 | \arguments{ 11 | \item{x}{eta_cov object} 12 | 13 | \item{dx}{data set} 14 | 15 | \item{...}{not used for the moment} 16 | } 17 | \value{ 18 | ggplot2 plot 19 | } 20 | \description{ 21 | This plots an ETA covariance matrix which can be used to define the co-relation between the parameters and 22 | its shrinkage 23 | } 24 | \seealso{ 25 | \code{\link{eta_cov}} 26 | 27 | Other plot_pmx: 28 | \code{\link{distrib}()}, 29 | \code{\link{eta_cov}()}, 30 | \code{\link{eta_pairs}()}, 31 | \code{\link{individual}()}, 32 | \code{\link{plot_pmx.distrib}()}, 33 | \code{\link{plot_pmx.eta_pairs}()}, 34 | \code{\link{plot_pmx.individual}()}, 35 | \code{\link{plot_pmx.pmx_dens}()}, 36 | \code{\link{plot_pmx.pmx_gpar}()}, 37 | \code{\link{plot_pmx.pmx_qq}()}, 38 | \code{\link{plot_pmx.residual}()}, 39 | \code{\link{plot_pmx}()} 40 | } 41 | \concept{plot_pmx} 42 | -------------------------------------------------------------------------------- /man/plot_pmx.eta_pairs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-eta-pairs.R 3 | \name{plot_pmx.eta_pairs} 4 | \alias{plot_pmx.eta_pairs} 5 | \title{Plot random effect correlation plot} 6 | \usage{ 7 | \method{plot_pmx}{eta_pairs}(x, dx, ...) 8 | } 9 | \arguments{ 10 | \item{x}{distribution object} 11 | 12 | \item{dx}{data set} 13 | 14 | \item{...}{not used for the moment} 15 | } 16 | \value{ 17 | ggpairs plot 18 | } 19 | \description{ 20 | Plot random effect correlation plot 21 | } 22 | \seealso{ 23 | \code{\link{distrib}} 24 | 25 | Other plot_pmx: 26 | \code{\link{distrib}()}, 27 | \code{\link{eta_cov}()}, 28 | \code{\link{eta_pairs}()}, 29 | \code{\link{individual}()}, 30 | \code{\link{plot_pmx.distrib}()}, 31 | \code{\link{plot_pmx.eta_cov}()}, 32 | \code{\link{plot_pmx.individual}()}, 33 | \code{\link{plot_pmx.pmx_dens}()}, 34 | \code{\link{plot_pmx.pmx_gpar}()}, 35 | \code{\link{plot_pmx.pmx_qq}()}, 36 | \code{\link{plot_pmx.residual}()}, 37 | \code{\link{plot_pmx}()} 38 | } 39 | \concept{plot_pmx} 40 | -------------------------------------------------------------------------------- /man/plot_pmx.individual.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-individual.R 3 | \name{plot_pmx.individual} 4 | \alias{plot_pmx.individual} 5 | \title{This function can be used to plot individual prediction and compare with observed data and population prediction 6 | for each individual separately} 7 | \usage{ 8 | \method{plot_pmx}{individual}(x, dx, ...) 9 | } 10 | \arguments{ 11 | \item{x}{individual object} 12 | 13 | \item{dx}{data set} 14 | 15 | \item{...}{not used for the moment} 16 | } 17 | \value{ 18 | a list of ggplot2 19 | } 20 | \description{ 21 | This function can be used to plot individual prediction and compare with observed data and population prediction 22 | for each individual separately 23 | } 24 | \seealso{ 25 | Other plot_pmx: 26 | \code{\link{distrib}()}, 27 | \code{\link{eta_cov}()}, 28 | \code{\link{eta_pairs}()}, 29 | \code{\link{individual}()}, 30 | \code{\link{plot_pmx.distrib}()}, 31 | \code{\link{plot_pmx.eta_cov}()}, 32 | \code{\link{plot_pmx.eta_pairs}()}, 33 | \code{\link{plot_pmx.pmx_dens}()}, 34 | \code{\link{plot_pmx.pmx_gpar}()}, 35 | \code{\link{plot_pmx.pmx_qq}()}, 36 | \code{\link{plot_pmx.residual}()}, 37 | \code{\link{plot_pmx}()} 38 | } 39 | \concept{plot_pmx} 40 | -------------------------------------------------------------------------------- /man/plot_pmx.pmx_dens.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-density.R 3 | \name{plot_pmx.pmx_dens} 4 | \alias{plot_pmx.pmx_dens} 5 | \title{This function plots EBE versus covariates using qq plots} 6 | \usage{ 7 | \method{plot_pmx}{pmx_dens}(x, dx, ...) 8 | } 9 | \arguments{ 10 | \item{x}{eta_cov object} 11 | 12 | \item{dx}{data set} 13 | 14 | \item{...}{not used for the moment} 15 | } 16 | \value{ 17 | ggplot2 plot 18 | } 19 | \description{ 20 | This function plots EBE versus covariates using qq plots 21 | } 22 | \seealso{ 23 | \code{\link{eta_cov}} 24 | 25 | Other plot_pmx: 26 | \code{\link{distrib}()}, 27 | \code{\link{eta_cov}()}, 28 | \code{\link{eta_pairs}()}, 29 | \code{\link{individual}()}, 30 | \code{\link{plot_pmx.distrib}()}, 31 | \code{\link{plot_pmx.eta_cov}()}, 32 | \code{\link{plot_pmx.eta_pairs}()}, 33 | \code{\link{plot_pmx.individual}()}, 34 | \code{\link{plot_pmx.pmx_gpar}()}, 35 | \code{\link{plot_pmx.pmx_qq}()}, 36 | \code{\link{plot_pmx.residual}()}, 37 | \code{\link{plot_pmx}()} 38 | } 39 | \concept{plot_pmx} 40 | -------------------------------------------------------------------------------- /man/plot_pmx.pmx_gpar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-base.R 3 | \name{plot_pmx.pmx_gpar} 4 | \alias{plot_pmx.pmx_gpar} 5 | \title{The ggPMX base plot function} 6 | \usage{ 7 | \method{plot_pmx}{pmx_gpar}(x, dx, ...) 8 | } 9 | \arguments{ 10 | \item{x}{object of pmx_gpar type} 11 | 12 | \item{dx}{plot} 13 | 14 | \item{...}{ignored parameters} 15 | } 16 | \value{ 17 | ggplot2 object 18 | } 19 | \description{ 20 | This function should be called internally by other plots to set 21 | general settings like , smoothing, add band, labelling, theming,... 22 | } 23 | \seealso{ 24 | Other plot_pmx: 25 | \code{\link{distrib}()}, 26 | \code{\link{eta_cov}()}, 27 | \code{\link{eta_pairs}()}, 28 | \code{\link{individual}()}, 29 | \code{\link{plot_pmx.distrib}()}, 30 | \code{\link{plot_pmx.eta_cov}()}, 31 | \code{\link{plot_pmx.eta_pairs}()}, 32 | \code{\link{plot_pmx.individual}()}, 33 | \code{\link{plot_pmx.pmx_dens}()}, 34 | \code{\link{plot_pmx.pmx_qq}()}, 35 | \code{\link{plot_pmx.residual}()}, 36 | \code{\link{plot_pmx}()} 37 | } 38 | \concept{plot_pmx} 39 | -------------------------------------------------------------------------------- /man/plot_pmx.pmx_qq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-qq.R 3 | \name{plot_pmx.pmx_qq} 4 | \alias{plot_pmx.pmx_qq} 5 | \title{This function plot EBE versus covariates using qq plots} 6 | \usage{ 7 | \method{plot_pmx}{pmx_qq}(x, dx, ...) 8 | } 9 | \arguments{ 10 | \item{x}{pmx_qq object} 11 | 12 | \item{dx}{data set} 13 | 14 | \item{...}{not used for the moment} 15 | } 16 | \value{ 17 | ggplot2 plot 18 | } 19 | \description{ 20 | This function plot EBE versus covariates using qq plots 21 | } 22 | \seealso{ 23 | \code{\link{eta_cov}} 24 | 25 | Other plot_pmx: 26 | \code{\link{distrib}()}, 27 | \code{\link{eta_cov}()}, 28 | \code{\link{eta_pairs}()}, 29 | \code{\link{individual}()}, 30 | \code{\link{plot_pmx.distrib}()}, 31 | \code{\link{plot_pmx.eta_cov}()}, 32 | \code{\link{plot_pmx.eta_pairs}()}, 33 | \code{\link{plot_pmx.individual}()}, 34 | \code{\link{plot_pmx.pmx_dens}()}, 35 | \code{\link{plot_pmx.pmx_gpar}()}, 36 | \code{\link{plot_pmx.residual}()}, 37 | \code{\link{plot_pmx}()} 38 | } 39 | \concept{plot_pmx} 40 | -------------------------------------------------------------------------------- /man/plot_pmx.residual.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-residual.R 3 | \name{plot_pmx.residual} 4 | \alias{plot_pmx.residual} 5 | \title{This function plots residual for each observed value by finding the difference between observed and predicted points. It also fits a distribution to the residual value.} 6 | \usage{ 7 | \method{plot_pmx}{residual}(x, dx, ...) 8 | } 9 | \arguments{ 10 | \item{x}{residual object} 11 | 12 | \item{dx}{data set} 13 | 14 | \item{...}{not used for the moment} 15 | } 16 | \value{ 17 | ggplot2 object 18 | } 19 | \description{ 20 | This function plots residual for each observed value by finding the difference between observed and predicted points. It also fits a distribution to the residual value. 21 | } 22 | \seealso{ 23 | \code{\link{residual}} 24 | 25 | Other plot_pmx: 26 | \code{\link{distrib}()}, 27 | \code{\link{eta_cov}()}, 28 | \code{\link{eta_pairs}()}, 29 | \code{\link{individual}()}, 30 | \code{\link{plot_pmx.distrib}()}, 31 | \code{\link{plot_pmx.eta_cov}()}, 32 | \code{\link{plot_pmx.eta_pairs}()}, 33 | \code{\link{plot_pmx.individual}()}, 34 | \code{\link{plot_pmx.pmx_dens}()}, 35 | \code{\link{plot_pmx.pmx_gpar}()}, 36 | \code{\link{plot_pmx.pmx_qq}()}, 37 | \code{\link{plot_pmx}()} 38 | } 39 | \concept{plot_pmx} 40 | -------------------------------------------------------------------------------- /man/plot_shrink.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-eta-pairs.R 3 | \name{plot_shrink} 4 | \alias{plot_shrink} 5 | \title{Plot shrink in eta matric} 6 | \usage{ 7 | plot_shrink(x, shrink.dx, shrink) 8 | } 9 | \arguments{ 10 | \item{x}{pmx_gpar object} 11 | 12 | \item{shrink.dx}{data.table of shrinkage} 13 | 14 | \item{shrink}{\code{pmxShrinkClass} shrinkage graphical parameter or 15 | \code{list} coercible into one} 16 | } 17 | \value{ 18 | ggplot2 object 19 | } 20 | \description{ 21 | Plot shrink in eta matric 22 | } 23 | -------------------------------------------------------------------------------- /man/plots.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{plots} 4 | \alias{plots} 5 | \title{Get plots description} 6 | \usage{ 7 | plots(ctr) 8 | } 9 | \arguments{ 10 | \item{ctr}{\code{pmxClass} controller object} 11 | } 12 | \value{ 13 | data.frame of plots 14 | } 15 | \description{ 16 | Get plots description 17 | } 18 | \seealso{ 19 | Other pmxclass: 20 | \code{\link{get_cats}()}, 21 | \code{\link{get_conts}()}, 22 | \code{\link{get_covariates}()}, 23 | \code{\link{get_data}()}, 24 | \code{\link{get_occ}()}, 25 | \code{\link{get_plot_config}()}, 26 | \code{\link{get_plot}()}, 27 | \code{\link{get_strats}()}, 28 | \code{\link{plot_names}()}, 29 | \code{\link{pmx_update}()}, 30 | \code{\link{set_data}()}, 31 | \code{\link{set_plot}()} 32 | } 33 | \concept{pmxclass} 34 | -------------------------------------------------------------------------------- /man/pmxOptions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggPMX-options.R 3 | \name{pmxOptions} 4 | \alias{pmxOptions} 5 | \title{This function can be used to set ggPMX options} 6 | \usage{ 7 | pmxOptions(...) 8 | } 9 | \arguments{ 10 | \item{...}{Options to set, with the form \code{name = value}.} 11 | } 12 | \description{ 13 | \code{getPmxOption} retrieves the value of a ggPMX option. 14 | \code{ggPMXOptions} sets the value of ggPMX options; it can also be used to 15 | return a list of all currently-set ggPMX options. 16 | } 17 | \details{ 18 | There is a global option set, which is available by default. 19 | } 20 | \section{Options used in ggPMX}{ 21 | 22 | 23 | \itemize{ 24 | \item \strong{template_dir:} path to template directory 25 | } 26 | } 27 | 28 | \examples{ 29 | \dontrun{ 30 | pmxOptions(template_dir = PATH_TO_CUSTOM_CONFIGURATION) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /man/pmx_bloq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{pmx_bloq} 4 | \alias{pmx_bloq} 5 | \title{Creates BLOQ object attributes} 6 | \usage{ 7 | pmx_bloq( 8 | cens = "CENS", 9 | limit = "LIMIT", 10 | colour = "pink", 11 | size = 2, 12 | linewidth = 1, 13 | alpha = 0.9, 14 | show = TRUE, 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{cens}{\code{character} the censoring column name} 20 | 21 | \item{limit}{\code{character} the limit column name (optional)} 22 | 23 | \item{colour}{\code{character} the color of the geom} 24 | 25 | \item{size}{\code{numeric} the size of the geom when using \code{geom_point()}} 26 | 27 | \item{linewidth}{\code{numeric} the line width of the segment when using \code{geom_segment()}} 28 | 29 | \item{alpha}{\code{numeric} the alpha of the geom} 30 | 31 | \item{show}{\code{logical} if FALSE remove all censory observations} 32 | 33 | \item{...}{any other graphical parameter} 34 | } 35 | \description{ 36 | Creates BLOQ object attributes 37 | } 38 | \details{ 39 | To define that a measurement is censored, the observation data set should include 40 | a CENSORING column ( default to `CENS` ) and put 1 for lower limit or -1 for upper limit. \cr 41 | Optionally, data set can contain have a limit column ( default to `LIMIT`) column to set the other limit. 42 | } 43 | -------------------------------------------------------------------------------- /man/pmx_combine_tables.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_read_nm_tables.R 3 | \name{pmx_combine_tables} 4 | \alias{pmx_combine_tables} 5 | \title{Combine tables} 6 | \usage{ 7 | pmx_combine_tables(x) 8 | } 9 | \arguments{ 10 | \item{x}{A list containing the tables (`x$data`) to be 11 | combined, their names (`x$name`), their number of rows (`x$nrow`) 12 | and their respective index (`x$index`).} 13 | } 14 | \value{ 15 | A list containing `data` and `index` of the combined table. 16 | } 17 | \description{ 18 | Combine tables 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/pmx_comp_shrink.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-all-compute.R 3 | \name{pmx_comp_shrink} 4 | \alias{pmx_comp_shrink} 5 | \title{Compute Shrinkage} 6 | \usage{ 7 | pmx_comp_shrink( 8 | ctr, 9 | fun = c("var", "sd"), 10 | strat.facet, 11 | strat.color, 12 | filter, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{ctr}{\code{pmxClass} controller object} 18 | 19 | \item{fun}{\code{character} can be sd or var , var by default} 20 | 21 | \item{strat.facet}{\code{formula} optional stratification parameter} 22 | 23 | \item{strat.color}{\code{character} optional stratification parameter} 24 | 25 | \item{filter}{optional filter which will be applied to plotting data} 26 | 27 | \item{...}{others parameters not used for the moment} 28 | } 29 | \value{ 30 | \code{data.table} 31 | } 32 | \description{ 33 | Compute Shrinkage 34 | } 35 | -------------------------------------------------------------------------------- /man/pmx_config.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/config.R 3 | \name{pmx_config} 4 | \alias{pmx_config} 5 | \title{This function can be used to define the pmx configuration used in plots. e.g. Monolix/Nonmem} 6 | \usage{ 7 | pmx_config(sys = "mlx", inputs, plots, ...) 8 | } 9 | \arguments{ 10 | \item{sys}{\code{charcarter} system used , monolix,nonmem,...} 11 | 12 | \item{inputs}{\code{charcater} path to the inputs settings file (yaml format)} 13 | 14 | \item{plots}{\code{charcater} path to the inputs settings file (yaml format)} 15 | 16 | \item{...}{extra arguments not used} 17 | } 18 | \value{ 19 | \code{pmxConfig} object 20 | } 21 | \description{ 22 | This function can be used to define the pmx configuration used in plots. e.g. Monolix/Nonmem 23 | } 24 | \details{ 25 | To create a controller user can create a pmxConfig object using \cr 26 | - either an input template file \cr 27 | - or a plot template file \cr 28 | - or both. \cr 29 | By default the 'standing' configuration will be used. 30 | } 31 | \examples{ 32 | # *************** Create a controller using custom plot configuration ***************** ------ 33 | 34 | library(ggPMX) 35 | theophylline <- file.path( 36 | system.file(package = "ggPMX"), "testdata", 37 | "theophylline" 38 | ) 39 | WORK_DIR <- file.path(theophylline, "Monolix") 40 | input_file <- file.path(theophylline, "data_pk.csv") 41 | 42 | 43 | # create a controller with a custom plots template 44 | ctr <- pmx_mlx( 45 | config = pmx_config( 46 | plots=file.path( system.file(package = "ggPMX"),"examples/plots.yaml"), 47 | inputs = system.file(package = "ggPMX","examples/custom_inputs.yaml") 48 | ), 49 | directory = WORK_DIR, 50 | input = input_file, 51 | dv = "Y", 52 | dvid = "DVID", 53 | cats = c("SEX"), 54 | conts = c("WT0", "AGE0"), 55 | strats = "STUD" 56 | ) 57 | 58 | ## get the list of plots 59 | ctr \%>\% plots 60 | ctr \%>\% get_plot("custom_res_time") 61 | ctr \%>\% get_plot("custom_npde_time") 62 | 63 | } 64 | -------------------------------------------------------------------------------- /man/pmx_copy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{pmx_copy} 4 | \alias{pmx_copy} 5 | \title{Creates a deep copy of the controller} 6 | \usage{ 7 | pmx_copy(ctr, keep_globals = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{ctr}{\code{pmxClass} object} 11 | 12 | \item{keep_globals}{\code{logical} if TRUE we keep the global parameters changed by pmx_settings} 13 | 14 | \item{...}{extra parameters passed to \code{pmx_settings}} 15 | } 16 | \value{ 17 | an object of \code{pmxClass} 18 | } 19 | \description{ 20 | Creates a deep copy of the controller 21 | } 22 | \details{ 23 | The controller is an `R6` object, it behaves like a reference object. 24 | Some functions ( methods) can have a side effect on the controller and modify it internally. 25 | Technically speaking we talk about chaining not piping here. However , 26 | using \code{pmx_copy} user can work on a copy of the controller. 27 | 28 | By default the copy does not keep global parameters set using pmx_settings. 29 | } 30 | \examples{ 31 | \donttest{ 32 | ctr <- theophylline() 33 | cctr <- ctr \%>\% pmx_copy() 34 | ## Any change in the ctr has no side effect in the ctr and vice versa 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /man/pmx_cov.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-eta-cov.R 3 | \name{pmx_cov} 4 | \alias{pmx_cov} 5 | \title{Select/Map covariates using human labels} 6 | \usage{ 7 | pmx_cov(values, labels = NULL) 8 | } 9 | \arguments{ 10 | \item{values}{\code{list} of covariates to use to create the plot} 11 | 12 | \item{labels}{\code{list} of covariates facets labels} 13 | } 14 | \value{ 15 | \code{pmxCOVObject} object 16 | } 17 | \description{ 18 | Select/Map covariates using human labels 19 | } 20 | \details{ 21 | In case of `pmx_plot_eta_cats` and `pmx_plot_eta_conts` you can customize the covariates 22 | and covaraites labels using `pmx_cov`. 23 | } 24 | -------------------------------------------------------------------------------- /man/pmx_dens.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-density.R 3 | \name{pmx_dens} 4 | \alias{pmx_dens} 5 | \title{Creates a density plot object} 6 | \usage{ 7 | pmx_dens( 8 | x, 9 | labels, 10 | dname = NULL, 11 | xlim = 3, 12 | var_line = NULL, 13 | snd_line = NULL, 14 | vline = NULL, 15 | is.legend = TRUE, 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{x}{\code{character} variable name to sample} 21 | 22 | \item{labels}{list of texts/titles used within the plot} 23 | 24 | \item{dname}{name of dataset to be used} 25 | 26 | \item{xlim}{\code{numeric} x axis limits} 27 | 28 | \item{var_line}{\code{list} variable density graphics parameters} 29 | 30 | \item{snd_line}{\code{list} normal density graphics parameters} 31 | 32 | \item{vline}{\code{list} vertical line graphics parameters} 33 | 34 | \item{is.legend}{\code{logical} whether to add a legend (defaults TRUE)} 35 | 36 | \item{...}{others graphics arguments passed to \code{\link{pmx_gpar}} internal object.} 37 | } 38 | \description{ 39 | Creates a density plot object 40 | } 41 | \details{ 42 | \strong{labels} is a list that contains: 43 | \itemize{ 44 | \item \strong{title:} plot title default "IWRES density plot" 45 | \item \strong{x:} x axis label default to "Etas" 46 | \item \strong{y:} y axis label default to empty 47 | } 48 | 49 | \strong{var_line} is a list that contains: 50 | \itemize{ 51 | \item \strong{linetype:} default to 1 52 | \item \strong{color:} default to black 53 | \item \strong{linewidth:} default to 1 54 | } 55 | 56 | \strong{snd_line} is a list that contains: 57 | \itemize{ 58 | \item \strong{linetype:} default to 2 59 | \item \strong{color:} default to black 60 | \item \strong{linewidth:} default to 1 61 | } 62 | 63 | \strong{vline} is a list that contains: 64 | \itemize{ 65 | \item \strong{linetype:} default to 3 66 | \item \strong{color:} default to black 67 | \item \strong{linewidth:} default to 1 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /man/pmx_endpoint.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{pmx_endpoint} 4 | \alias{pmx_endpoint} 5 | \title{Creates pmx endpoint object} 6 | \usage{ 7 | pmx_endpoint(code, label = "", unit = "", file.code = code, trans = NULL) 8 | } 9 | \arguments{ 10 | \item{code}{\code{character} endpoint code : used to filter observations DVID==code.} 11 | 12 | \item{label}{\code{character} endpoint label: used to set title and axis labels} 13 | 14 | \item{unit}{\code{character} endpoint unit : used to set title and axis labels} 15 | 16 | \item{file.code}{\code{character} endpoint file code : used to set predictions and finegrid \cr 17 | files extensions in case using code parameter is not enough.} 18 | 19 | \item{trans}{\code{list} Transformation parameter not used yet.} 20 | } 21 | \description{ 22 | Creates pmx endpoint object 23 | } 24 | \details{ 25 | In case of multiple endpoints, pkpd case for example, we need to pass endpoint to the pmx call. 26 | Internally , ggPMX will filter the observations data set to keep only rows satisfying \code{DVID==code}. 27 | The \code{code} is also used to find the right predictions and or fingrid files. 28 | ggPMX use the configuration file to fine the path of the predictions file 29 | (like the single endpoint case) and then filter the right file using the code parameter. \cr 30 | For example: 31 | \itemize{ 32 | \item predictions\{code\}.txt for mlx16 33 | \item predictions\{code\}.txt and y\{code\}_residual for mlx18 34 | } 35 | 36 | For some tricky examples the code parameter is not enough to find the files. In that case the 37 | \code{file.code} parameter is used to distinguish the endpoint files. 38 | } 39 | \examples{ 40 | \donttest{ 41 | ## Use file.code parameter 42 | pk_pd_path <- file.path(system.file(package = "ggPMX"), "testdata","pk_pd") 43 | 44 | WORK_DIR <- file.path(pk_pd_path, "RESULTS") 45 | 46 | ep <- pmx_endpoint( 47 | code="4", 48 | file.code="2" 49 | ) 50 | 51 | input_file <- file.path(pk_pd_path, "pk_pd.csv") 52 | 53 | ctr <- pmx_mlx( 54 | config = "standing", 55 | directory = WORK_DIR, 56 | input = input_file, 57 | dv = "dv", 58 | dvid = "dvid", 59 | cats = "sex", 60 | conts = "wt", 61 | endpoint = ep 62 | ) 63 | 64 | ## using mlxtran 65 | 66 | ep <- pmx_endpoint( 67 | code="3", 68 | file.code="1" 69 | ) 70 | 71 | mlxtran_file <- file.path(pk_pd_path, "pk_pd.mlxtran") 72 | ctr <- pmx_mlxtran(mlxtran_file,endpoint=ep) 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /man/pmx_file_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_utils_nonmem_reader.R 3 | \name{pmx_file_path} 4 | \alias{pmx_file_path} 5 | \title{Generate clean file paths} 6 | \usage{ 7 | pmx_file_path(dir, file) 8 | } 9 | \arguments{ 10 | \item{dir}{A string or vector of strings containing the directory path.} 11 | 12 | \item{file}{A file name or vector containing the file names.} 13 | } 14 | \value{ 15 | A string or vector of string of the full file path. 16 | } 17 | \description{ 18 | Wrapper around `file.path` that cleans trailing forward 19 | slash and missing `dir`. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/pmx_filter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-filter.R 3 | \name{pmx_filter} 4 | \alias{pmx_filter} 5 | \title{filter data in a pmx controller} 6 | \usage{ 7 | pmx_filter( 8 | ctr, 9 | data_set = c("estimates", "predictions", "eta", "finegrid", "shrink", "input", 10 | "individual", "sim_blq"), 11 | pmx_exp 12 | ) 13 | } 14 | \arguments{ 15 | \item{ctr}{A controller. An object of 'pmxClass'} 16 | 17 | \item{data_set}{A data_set within the controller to apply a filter to.} 18 | 19 | \item{pmx_exp}{A filter expression} 20 | } 21 | \value{ 22 | Returns a pmx controller with a filtered data set. 23 | } 24 | \description{ 25 | filter data in a pmx controller 26 | } 27 | \examples{ 28 | \donttest{ 29 | ## example of global filter 30 | ctr <- theophylline() 31 | ctr \%>\% pmx_filter(data_set = "prediction", ID == 5 & TIME < 2) 32 | ctr \%>\% get_data("prediction") 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /man/pmx_get_configs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/config.R 3 | \name{pmx_get_configs} 4 | \alias{pmx_get_configs} 5 | \title{Get List of built-in configurations} 6 | \usage{ 7 | pmx_get_configs(sys = "mlx") 8 | } 9 | \arguments{ 10 | \item{sys}{can be mlx, by default all configurations will be listed} 11 | } 12 | \value{ 13 | names of the config 14 | } 15 | \description{ 16 | Get List of built-in configurations 17 | } 18 | \examples{ 19 | pmx_get_configs() 20 | } 21 | -------------------------------------------------------------------------------- /man/pmx_get_extension.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_utils_nonmem_reader.R 3 | \name{pmx_get_extension} 4 | \alias{pmx_get_extension} 5 | \title{Get file extension} 6 | \usage{ 7 | pmx_get_extension(x, dot = TRUE) 8 | } 9 | \arguments{ 10 | \item{x}{A string or vector of strings containing the filenames with the extension.} 11 | 12 | \item{dot}{Logical, if `TRUE` the returned value will contain the 13 | dot (e.g `.mod`) else only the extension itself will be returned (e.g. `mod`).} 14 | } 15 | \value{ 16 | A string or vector of string of the file(s) extension. 17 | } 18 | \description{ 19 | Extract file extension from the filename string. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/pmx_gpar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gpar.R 3 | \name{pmx_gpar} 4 | \alias{pmx_gpar} 5 | \title{Handling pmx Graphical parameters} 6 | \usage{ 7 | pmx_gpar( 8 | is.title, 9 | labels, 10 | axis.title, 11 | which_pages, 12 | print, 13 | axis.text, 14 | ranges, 15 | is.smooth, 16 | smooth, 17 | is.band, 18 | band, 19 | is.draft, 20 | draft, 21 | discrete, 22 | is.identity_line, 23 | identity_line, 24 | smooth_with_bloq, 25 | scale_x_log10, 26 | scale_y_log10, 27 | color.scales, 28 | is.legend, 29 | legend.position 30 | ) 31 | } 32 | \arguments{ 33 | \item{is.title}{\code{logical} if TRUE then a title is used for the plot} 34 | 35 | \item{labels}{list of labels, like title, subtitle, x , y} 36 | 37 | \item{axis.title}{list or element_text (same as ggplot2 axis.title theme)} 38 | 39 | \item{which_pages}{page(s) to display; if "all" display all pages, 40 | if 1 display first page, if c(1,2) display first and second pages} 41 | 42 | \item{print}{if TRUE the ouptut will be a print not a ggplot2. This 43 | is useful for rmarkdwon output to avoid verbose list index print.} 44 | 45 | \item{axis.text}{list or element_text (same as ggplot2 axis.text theme)} 46 | 47 | \item{ranges}{limits of x/y ranges} 48 | 49 | \item{is.smooth}{logical if set to TRUE add smooth layer} 50 | 51 | \item{smooth}{smooth layer parameters} 52 | 53 | \item{is.band}{logical if TRUE add horizontal band} 54 | 55 | \item{band}{horizontal band parameters} 56 | 57 | \item{is.draft}{logical if TRUE add draft layer} 58 | 59 | \item{draft}{draft layer parameters} 60 | 61 | \item{discrete}{logical if TRUE x axis is discrete(FALSE by default)} 62 | 63 | \item{is.identity_line}{\code{logical} if TRUE add y=x line} 64 | 65 | \item{identity_line}{\code{list} y=x aes properties} 66 | 67 | \item{smooth_with_bloq}{\code{logical} if TRUE perform spline in plots with BLOQ data} 68 | 69 | \item{scale_x_log10}{logical if TRUE add scale_x_log10 layer} 70 | 71 | \item{scale_y_log10}{logical if TRUE add scale_y_log10 layer} 72 | 73 | \item{color.scales}{\code{list} define scales parameter in case of strat.color \code{\link{pmx_settings}}} 74 | 75 | \item{is.legend}{\code{logical} if TRUE x axis is discrete(FALSE by default)} 76 | 77 | \item{legend.position}{\code{charcater} legend position it takes the same value as the equivalent ggplot2 parameter} 78 | } 79 | \value{ 80 | An object of class \code{"pmx_gpar"}. 81 | } 82 | \description{ 83 | Handling pmx Graphical parameters 84 | } 85 | \details{ 86 | This object contains all general graphic settings. It used internally by all 87 | pmx_plot(generic function) to set the default behavior. 88 | } 89 | -------------------------------------------------------------------------------- /man/pmx_index_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_read_nm_tables.R 3 | \name{pmx_index_table} 4 | \alias{pmx_index_table} 5 | \title{Index table columns} 6 | \usage{ 7 | pmx_index_table(x) 8 | } 9 | \arguments{ 10 | \item{x}{A list containing the tables (`x$data`) to be 11 | combined along with their respective names (`x$name`).} 12 | } 13 | \value{ 14 | A tibble of the index. 15 | } 16 | \description{ 17 | Index table columns 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/pmx_is.nm.table.list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_utils_nonmem_reader.R 3 | \name{pmx_is.nm.table.list} 4 | \alias{pmx_is.nm.table.list} 5 | \title{Test for nm_table_list class} 6 | \usage{ 7 | pmx_is.nm.table.list(x) 8 | } 9 | \arguments{ 10 | \item{x}{An object to be tested.} 11 | } 12 | \value{ 13 | Logical value, `TRUE` for `nm_table_list` class 14 | and `FALSE` otherwise. 15 | } 16 | \description{ 17 | Reports whether x is a `nm_table_list` object 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/pmx_list_nm_tables.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_list_nm_tables.R 3 | \name{pmx_list_nm_tables} 4 | \alias{pmx_list_nm_tables} 5 | \title{List NONMEM output tables} 6 | \usage{ 7 | pmx_list_nm_tables(nm_model = NULL) 8 | } 9 | \arguments{ 10 | \item{nm_model}{An nm_model object generated with \code{\link{pmx_read_nm_model}}.} 11 | } 12 | \description{ 13 | List NONMEM output tables file names from a \code{nm_model} object. 14 | } 15 | \examples{ 16 | \dontrun{ 17 | pmx_read_nm_model(file = 'run001.lst') \%>\% 18 | pmx_list_nm_tables() 19 | } 20 | 21 | } 22 | \seealso{ 23 | \code{\link{pmx_read_nm_model}}, \code{\link{pmx_read_nm_tables}} 24 | } 25 | -------------------------------------------------------------------------------- /man/pmx_list_nm_tables_manual.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_manual_import.R 3 | \name{pmx_list_nm_tables_manual} 4 | \alias{pmx_list_nm_tables_manual} 5 | \title{Creates an nm_table_list from manually defined table name patterns} 6 | \usage{ 7 | pmx_list_nm_tables_manual(runno = NULL, file = NULL, dir = NULL, tab_list) 8 | } 9 | \arguments{ 10 | \item{runno}{Run number to be used to generate model file name.} 11 | 12 | \item{file}{Model file name containing the file extension.} 13 | 14 | \item{dir}{Location of the model files.} 15 | 16 | \item{tab_list}{A list of table definition generated by `pmx_manual_nm_import`.} 17 | } 18 | \value{ 19 | A `nm_table_list` 20 | } 21 | \description{ 22 | Creates an nm_table_list from manually defined table name patterns 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/pmx_make_extension.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_utils_nonmem_reader.R 3 | \name{pmx_make_extension} 4 | \alias{pmx_make_extension} 5 | \title{Generate extension string} 6 | \usage{ 7 | pmx_make_extension(x) 8 | } 9 | \arguments{ 10 | \item{x}{A string or vector of strings containing the extension to be standardized.} 11 | } 12 | \value{ 13 | A string or vector of strings of extension(s). 14 | } 15 | \description{ 16 | Generate consistent extension strings by adding dot 17 | prefix whenever necessary. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/pmx_manual_nm_import.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_manual_import.R 3 | \name{pmx_manual_nm_import} 4 | \alias{pmx_manual_nm_import} 5 | \title{Manually define nonmem tables to be imported} 6 | \usage{ 7 | pmx_manual_nm_import( 8 | tab_names = c("sdtab", "mutab", "patab", "catab", "cotab", "mytab", "extra", "xptab", 9 | "cwtab"), 10 | tab_suffix = "", 11 | sim_suffix = "sim" 12 | ) 13 | } 14 | \arguments{ 15 | \item{tab_names}{Provide the name of the tables to import e.g. 'sdtab', 'patab', 'cotab', 16 | 'catab' for NONMEM.} 17 | 18 | \item{tab_suffix}{Default is '', but can be changed to any character string to be used as 19 | suffix in the table names.} 20 | 21 | \item{sim_suffix}{Default is 'sim', but can be changed to any character string to be used as 22 | suffix in the simulation table names e.g. sdtab001sim.} 23 | } 24 | \description{ 25 | Manually provide names of the table files to be imported. 26 | } 27 | -------------------------------------------------------------------------------- /man/pmx_merge_firstonly.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_read_nm_tables.R 3 | \name{pmx_merge_firstonly} 4 | \alias{pmx_merge_firstonly} 5 | \title{Merge firstonly table with full length tables} 6 | \usage{ 7 | pmx_merge_firstonly(x, quiet) 8 | } 9 | \arguments{ 10 | \item{x}{A list containing the tables (`x$data`) to be 11 | merged, the firstonly flag (`x$firstonly`) and the 12 | indexes (`x$index`).} 13 | 14 | \item{quiet}{Should messages be displayed to the console.} 15 | } 16 | \value{ 17 | A list containing `data` and `index` of the merged table. 18 | } 19 | \description{ 20 | Merge firstonly table with full length tables 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/pmx_msg.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_utils_nonmem_reader.R 3 | \name{pmx_msg} 4 | \alias{pmx_msg} 5 | \title{Message function} 6 | \usage{ 7 | pmx_msg(txt, quiet = TRUE) 8 | } 9 | \arguments{ 10 | \item{txt}{A string for the message.} 11 | 12 | \item{quiet}{Should messages be displayed to the console.} 13 | } 14 | \value{ 15 | Silent when quiet is `TRUE` or a message is quiet is `FALSE`. 16 | } 17 | \description{ 18 | Message function with quiet option inspired from `ronkeizer/vpc`. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/pmx_nlmixr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/nlmixr.R 3 | \name{pmx_nlmixr} 4 | \alias{pmx_nlmixr} 5 | \title{Creates pmx controller from an nlimxr fit object} 6 | \usage{ 7 | pmx_nlmixr(fit, dvid, conts, cats, strats, endpoint, settings, vpc = FALSE) 8 | } 9 | \arguments{ 10 | \item{fit}{nlmixr object} 11 | 12 | \item{dvid}{\emph{[Optional]} \code{character} observation type parameter.} 13 | 14 | \item{conts}{\emph{[Optional]}\code{character} vector of continuous covariates} 15 | 16 | \item{cats}{\emph{[Optional]}\code{character} vector of categorical covariates} 17 | 18 | \item{strats}{\emph{[Optional]}\code{character} extra stratification variables} 19 | 20 | \item{endpoint}{\code{pmxEndpointClass} or \code{integer} or \code{charcater} defalut to NULL 21 | of the endpoint code. \code{\link{pmx_endpoint}}} 22 | 23 | \item{settings}{\emph{[Optional]}\code{pmxSettingsClass} \code{\link{pmx_settings}}} 24 | 25 | \item{vpc}{\emph{[Optional]} \code{logical} a boolean indiacting if vpc should be calculated (by default \code{TRUE})} 26 | } 27 | \value{ 28 | \code{pmxClass} controller object. 29 | } 30 | \description{ 31 | Creates pmx controller from an nlimxr fit object 32 | } 33 | -------------------------------------------------------------------------------- /man/pmx_parse_nm_files.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_read_nm_files.R 3 | \name{pmx_parse_nm_files} 4 | \alias{pmx_parse_nm_files} 5 | \title{Parse NONMEM output files} 6 | \usage{ 7 | pmx_parse_nm_files(dat, quiet) 8 | } 9 | \arguments{ 10 | \item{dat}{A list containing the raw data as vector of strings (`dat$raw`) 11 | and their respective file names (`dat$name`).} 12 | 13 | \item{quiet}{Logical, if \code{FALSE} messages are printed to the console.} 14 | } 15 | \value{ 16 | A tibble containing the parsed `data` along with `name`, `problem`, 17 | `subprob`, and `method`. 18 | } 19 | \description{ 20 | Function parsing NONMEM output files from their 21 | raw input. 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /man/pmx_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-all-plots.R 3 | \name{pmx_plot} 4 | \alias{pmx_plot} 5 | \title{Generic pmx plot} 6 | \usage{ 7 | pmx_plot(ctr, pname, ...) 8 | } 9 | \arguments{ 10 | \item{ctr}{\code{pmxClass} pmx controller} 11 | 12 | \item{pname}{plot name} 13 | 14 | \item{...}{others graphics parameters passed : 15 | \itemize{ 16 | \item \code{\link{pmx_gpar}} internal function to customize shared graphical parameters 17 | \item \code{\link{pmx_qq}} quantile-quantile plot object 18 | \item \code{\link{pmx_update}} function. 19 | }} 20 | } 21 | \description{ 22 | Generic pmx plot 23 | } 24 | -------------------------------------------------------------------------------- /man/pmx_plot_cats.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-all-plots.R 3 | \name{pmx_plot_cats} 4 | \alias{pmx_plot_cats} 5 | \title{Generic pmx stratified plot} 6 | \usage{ 7 | pmx_plot_cats(ctr, pname, cats, chunk = "", print = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{ctr}{\code{pmxClass} pmx controller} 11 | 12 | \item{pname}{plot name} 13 | 14 | \item{cats}{list of categorical variables. By default all of them} 15 | 16 | \item{chunk}{chunk name} 17 | 18 | \item{print}{\code{logical} if TRUE print plots otherwise the list of plots is returned} 19 | 20 | \item{...}{others graphics parameters passed : 21 | \itemize{ 22 | \item \code{\link{pmx_gpar}} internal function to customize shared graphical parameters 23 | \item \code{\link{pmx_qq}} quantile-quantile plot object 24 | \item \code{\link{pmx_update}} function. 25 | }} 26 | } 27 | \description{ 28 | Generic pmx stratified plot 29 | } 30 | -------------------------------------------------------------------------------- /man/pmx_qq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-qq.R 3 | \name{pmx_qq} 4 | \alias{pmx_qq} 5 | \title{This function creates a qq plot object} 6 | \usage{ 7 | pmx_qq( 8 | x, 9 | labels, 10 | dname = NULL, 11 | point = NULL, 12 | xmax = TRUE, 13 | facets = NULL, 14 | is.reference_line = NULL, 15 | reference_line = NULL, 16 | is.shrink = NULL, 17 | shrink = NULL, 18 | is.hline = NULL, 19 | hline = NULL, 20 | is.vline = NULL, 21 | vline = NULL, 22 | ... 23 | ) 24 | } 25 | \arguments{ 26 | \item{x}{\code{character} variable name to sample} 27 | 28 | \item{labels}{list of texts/titles used within the plot} 29 | 30 | \item{dname}{name of dataset to be used} 31 | 32 | \item{point}{\code{list} geom_point attributes color, shape,...} 33 | 34 | \item{xmax}{\code{logical} if FALSE do not use max(aes(x)) as limits default to TRUE} 35 | 36 | \item{facets}{\code{list}} 37 | 38 | \item{is.reference_line}{\code{logical} if TRUE add reference line to the plot} 39 | 40 | \item{reference_line}{\code{list} geom_line attributes. Used only for pmx_plot_eta_qq} 41 | 42 | \item{is.shrink}{\code{logical} if TRUE add shrinkage to the plot} 43 | 44 | \item{shrink}{\code{pmxShrinkClass} shrinkage graphical parameter or 45 | \code{list} coercible into one} 46 | 47 | \item{is.hline}{logical if TRUE add horizontal line y=0 ( TRUE by default)} 48 | 49 | \item{hline}{geom hline graphical parameters} 50 | 51 | \item{is.vline}{logical if TRUE add vertical line x=0 ( TRUE by default)} 52 | 53 | \item{vline}{geom vline graphical parameters} 54 | 55 | \item{...}{others graphics arguments passed to \code{\link{pmx_gpar}} internal object.} 56 | } 57 | \value{ 58 | \code{pmx_qq} object 59 | } 60 | \description{ 61 | This function creates a qq plot object 62 | } 63 | \details{ 64 | \strong{labels} is a list that contains: 65 | \itemize{ 66 | \item \strong{title:} plot title default "EBE vs. covariates" 67 | \item \strong{x:} x axis label default to "Etas" 68 | \item \strong{y:} y axis label default to empty 69 | } 70 | 71 | \strong{point} is a list that contains: 72 | \itemize{ 73 | \item \strong{shape:} default to 1 74 | \item \strong{color:} default to black 75 | \item \strong{size:} default to 1 76 | } 77 | } 78 | \concept{qq_plot} 79 | -------------------------------------------------------------------------------- /man/pmx_raw_to_tibble.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_read_nm_files.R 3 | \name{pmx_raw_to_tibble} 4 | \alias{pmx_raw_to_tibble} 5 | \title{Convert raw strings to tibble} 6 | \usage{ 7 | pmx_raw_to_tibble(x, sep, file) 8 | } 9 | \arguments{ 10 | \item{x}{A list containing the raw data as vector of strings (`x$raw`).} 11 | 12 | \item{sep}{A separator which will be used to create columns.} 13 | 14 | \item{file}{The name of the file to be parsed.} 15 | } 16 | \value{ 17 | A tibble. 18 | } 19 | \description{ 20 | Convert raw data strings to a tibble format. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/pmx_read_args.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_read_nm_tables.R 3 | \name{pmx_read_args} 4 | \alias{pmx_read_args} 5 | \title{Define data import arguments} 6 | \usage{ 7 | pmx_read_args( 8 | x, 9 | quiet, 10 | col_types = readr::cols(.default = "d"), 11 | na = "NA", 12 | comment = "TABLE", 13 | skip = 1, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{A list containing a the 3 first records of a 19 | dataset under `[[1]]`.} 20 | 21 | \item{quiet}{Should messages be displayed to the console.} 22 | 23 | \item{col_types}{Defines the type of each column to be passed to 24 | the `readr` import function.} 25 | 26 | \item{na}{Character string defining the values to be treated as `NA`.} 27 | 28 | \item{comment}{Character string defining the value to mark comments.} 29 | 30 | \item{skip}{Number of rows to be skipped before reading the data.} 31 | 32 | \item{...}{Additional arguments to be passed to the `readr` function} 33 | } 34 | \value{ 35 | A list of 2 levels fun (the import function) and params (a list 36 | of arguments to be used when calling fun). 37 | } 38 | \description{ 39 | Define data import arguments 40 | } 41 | \keyword{internal} 42 | -------------------------------------------------------------------------------- /man/pmx_read_funs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_read_nm_tables.R 3 | \name{pmx_read_funs} 4 | \alias{pmx_read_funs} 5 | \title{Define data import functions} 6 | \usage{ 7 | pmx_read_funs(fun) 8 | } 9 | \arguments{ 10 | \item{fun}{Abbreviated `readr` data import function. 11 | Can be `csv`, `csv2` or `table`.} 12 | } 13 | \value{ 14 | A data import function. 15 | } 16 | \description{ 17 | Define data import functions 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/pmx_read_nm_files.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_read_nm_files.R 3 | \name{pmx_read_nm_files} 4 | \alias{pmx_read_nm_files} 5 | \title{NONMEM output file import function} 6 | \usage{ 7 | pmx_read_nm_files( 8 | runno = NULL, 9 | prefix = "run", 10 | ext = c(".ext", ".cor", ".cov", ".phi", ".grd", ".shk"), 11 | file = NULL, 12 | dir = NULL, 13 | quiet = FALSE 14 | ) 15 | } 16 | \arguments{ 17 | \item{runno}{Run number to be evaluated.} 18 | 19 | \item{prefix}{Prefix of the model file names.} 20 | 21 | \item{ext}{A vector of the file extension to import. By default '.ext', '.cor', '.cov', '.phi', '.grd', '.shk' 22 | files are listed.} 23 | 24 | \item{file}{Names of the model output file to be imported. Alternative argument to \code{prefix}, 25 | \code{runno} and \code{ext}.} 26 | 27 | \item{dir}{Location of the model files.} 28 | 29 | \item{quiet}{Logical, if \code{FALSE} messages are printed to the console.} 30 | } 31 | \description{ 32 | Quickly import NONMEM output files into R. 33 | } 34 | \examples{ 35 | \dontrun{ 36 | # Using the `file` argument to import a model file: 37 | ext_file <- pmx_read_nm_files(file = 'run001.ext', dir = 'models') 38 | 39 | # Using the `runno` argument to import a model file: 40 | ext_file <- pmx_read_nm_files(runno = '001', ext = '.ext', dir = 'models') 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /man/pmx_read_nm_model.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_read_nm_model.R 3 | \name{pmx_read_nm_model} 4 | \alias{pmx_read_nm_model} 5 | \title{NONMEM model file parser} 6 | \usage{ 7 | pmx_read_nm_model( 8 | runno = NULL, 9 | prefix = "run", 10 | ext = ".lst", 11 | file = NULL, 12 | dir = NULL 13 | ) 14 | } 15 | \arguments{ 16 | \item{runno}{run number which is used for generating the model file name} 17 | 18 | \item{prefix}{Prefix to be used to generate model file name. Used in combination with \code{runno} and \code{ext}.} 19 | 20 | \item{ext}{Extension to be used to generate model file name. Should be one of'.lst' (default), '.out', '.res', '.mod' or '.ctl' for NONMEM.} 21 | 22 | \item{file}{A character vector of path to the files or a \code{nm_table_list} object created with \code{list_nm_tables}.} 23 | 24 | \item{dir}{directory of the model files.} 25 | } 26 | \value{ 27 | A \code{\link[dplyr]{tibble}} of class \code{model} containing the following columns: 28 | \itemize{ 29 | \item \strong{problem}: a numeric identifier for the $PROBLEM associated with the code. 30 | \item \strong{level}: a unique numeric identifier to each subroutine block associated with the code. 31 | \item \strong{subroutine}: a character identifier named after the 3 first letters of the subroutine name e.g. '$THETA' and 32 | '$TABLE' will become 'the' and 'tab' respectively. In addition all output from the .lst is labeled 'lst', the general nonmem 33 | output e.g. NM-TRAN messages are labelled 'oth'. With priors thp, tpv, omp, opd, sip, spd abbreviations are given to the THETAP, 34 | THETAPV, OMEGAP, etc. 35 | \item \strong{code}: the code without comments or subroutine names e.g. '$THETA 0.5 ; TVCL' will return '0.5'. 36 | \item \strong{comment}: the last comment of a record e.g. '0.5 ; Clearance (L/h) ; TVCL' will return 'TVCL'. 37 | } 38 | } 39 | \description{ 40 | Parse NONMEM model files in R format 41 | } 42 | \examples{ 43 | \dontrun{ 44 | # Using the `file` argument to import a model file: 45 | nm_model <- pmx_read_nm_model(file = 'run001.lst', dir = 'models') 46 | 47 | # Using the `runno` argument to import a model file: 48 | nm_model <- pmx_read_nm_model(runno = '001', ext = '.lst', dir = 'models') 49 | } 50 | 51 | } 52 | \seealso{ 53 | \code{\link{pmx_read_nm_tables}} 54 | } 55 | -------------------------------------------------------------------------------- /man/pmx_register_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-all-plots.R 3 | \name{pmx_register_plot} 4 | \alias{pmx_register_plot} 5 | \title{Register plot} 6 | \usage{ 7 | pmx_register_plot(ctr, pp, pname = NULL) 8 | } 9 | \arguments{ 10 | \item{ctr}{\code{pmxClass} controller} 11 | 12 | \item{pp}{\code{ggplot2} plot} 13 | 14 | \item{pname}{\code{character} plot nme} 15 | } 16 | \description{ 17 | Register plot 18 | } 19 | -------------------------------------------------------------------------------- /man/pmx_report_template.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-report.R 3 | \name{pmx_report_template} 4 | \alias{pmx_report_template} 5 | \title{Gets build-in report templates} 6 | \usage{ 7 | pmx_report_template() 8 | } 9 | \value{ 10 | list of templates names 11 | } 12 | \description{ 13 | Gets build-in report templates 14 | } 15 | \examples{ 16 | pmx_report_template() 17 | } 18 | -------------------------------------------------------------------------------- /man/pmx_settings.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{pmx_settings} 4 | \alias{pmx_settings} 5 | \title{Create controller global settings} 6 | \usage{ 7 | pmx_settings( 8 | is.draft = TRUE, 9 | use.abbrev = TRUE, 10 | color.scales = NULL, 11 | cats.labels = NULL, 12 | use.labels = FALSE, 13 | use.titles = FALSE, 14 | effects = NULL, 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{is.draft}{\code{logical} if FALSE any plot is without draft annotation} 20 | 21 | \item{use.abbrev}{\code{logical} if FALSE use full description from abbreviation mapping for axis names} 22 | 23 | \item{color.scales}{\code{list} list containing elements of scale_color_manual} 24 | 25 | \item{cats.labels}{\code{list} list of named vectors for each factor} 26 | 27 | \item{use.labels}{\code{logical} if TRUE replace factor named by cats.labels} 28 | 29 | \item{use.titles}{\code{logical} FALSE to generate plots without titles} 30 | 31 | \item{effects}{\code{list} list of effects levels and labels} 32 | 33 | \item{...}{extra parameter not used yet} 34 | } 35 | \value{ 36 | pmxSettingsClass object 37 | } 38 | \description{ 39 | Create controller global settings 40 | } 41 | \examples{ 42 | \donttest{ 43 | 44 | library(ggPMX) 45 | library(ggplot2) 46 | ctr <- theophylline( 47 | settings= 48 | pmx_settings( 49 | color.scales=list( 50 | "Study", 51 | labels=c("Study 1","Study 2"), 52 | values=c("1"="lightyellow","2"="lightblue")), 53 | cats.labels=list( 54 | SEX=c("0"="M","1"="F"), 55 | STUD=c("1"="Study 1","2"="Study 2") 56 | ), 57 | use.abbrev=TRUE, 58 | is.draft=TRUE, 59 | use.labels=TRUE 60 | ) 61 | ) 62 | 63 | 64 | 65 | ctr \%>\% 66 | pmx_plot_npde_time(strat.color="STUD",strat.facet=~SEX) 67 | # 68 | # 69 | ctr \%>\% 70 | pmx_plot_eta_box(strat.color="STUD", strat.facet =~SEX) 71 | 72 | ctr \%>\% pmx_plot_eta_hist 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /man/pmx_shrink.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{pmx_shrink} 4 | \alias{pmx_shrink} 5 | \title{Create shrinkage parameter object} 6 | \usage{ 7 | pmx_shrink( 8 | fun = c("var", "sd"), 9 | size = 1, 10 | color = "green", 11 | vjust = 1.5, 12 | hjust = 0.5, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{fun}{\code{list} shrinkage function can be \code{sd} or \code{var}} 18 | 19 | \item{size}{\code{numeric} shrinkage text size} 20 | 21 | \item{color}{\code{character} shrinkage text color} 22 | 23 | \item{vjust}{\code{numeric} shrinkage position vertical adjustment} 24 | 25 | \item{hjust}{\code{numeric} shrinkage position horizontal adjustment} 26 | 27 | \item{...}{any other parameter} 28 | } 29 | \value{ 30 | \code{pmxShrinkClass} object (\code{list}) 31 | } 32 | \description{ 33 | Create shrinkage parameter object 34 | } 35 | -------------------------------------------------------------------------------- /man/pmx_sim.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{pmx_sim} 4 | \alias{pmx_sim} 5 | \title{Create simulation object} 6 | \usage{ 7 | pmx_sim(file, data, irun, idv) 8 | } 9 | \arguments{ 10 | \item{file}{\code{character} path to the simulation file} 11 | 12 | \item{data}{\code{data.table} simulation data} 13 | 14 | \item{irun}{\code{character} name of the simulation column} 15 | 16 | \item{idv}{\code{character} name of the ind. variable} 17 | } 18 | \description{ 19 | Create simulation object 20 | } 21 | \examples{ 22 | \donttest{ 23 | library(ggPMX) 24 | 25 | theo_path <- file.path( 26 | system.file(package = "ggPMX"), "testdata", 27 | "theophylline" 28 | ) 29 | WORK_DIR <- file.path(theo_path, "Monolix") 30 | input_file <- file.path(theo_path, "data_pk.csv") 31 | vpc_file <- file.path(theo_path, "sim.csv") 32 | 33 | ctr <- pmx_mlx( 34 | config = "standing", 35 | directory = WORK_DIR, 36 | input = input_file, 37 | dv = "Y", 38 | dvid = "dvid", 39 | cats = c("SEX"), 40 | conts = c("WT0", "AGE0"), 41 | strats = "STUD", 42 | settings = pmx_settings( 43 | use.labels=TRUE, 44 | cats.labels=list( 45 | SEX=c("0"="Male","1"="Female") 46 | ) 47 | ), 48 | sim = pmx_sim( 49 | file = vpc_file, 50 | irun ="rep", 51 | idv="TIME" 52 | ) 53 | ) 54 | 55 | 56 | ctr \%>\% pmx_plot_vpc( 57 | strat.facet=~SEX, 58 | facets=list(nrow=2), 59 | type="percentile", 60 | is.draft = FALSE, 61 | pi = pmx_vpc_pi(interval = c(0.1,0.9), 62 | median=list(color="green"), 63 | extreme= list(color="green")), 64 | obs = pmx_vpc_obs(color="blue",shape=18,size=2), 65 | ci = pmx_vpc_ci(interval = c(0.1,0.9), 66 | median=list(fill="pink")), 67 | bin=pmx_vpc_bin("kmeans",n=5) 68 | ) 69 | 70 | ctr \%>\% 71 | pmx_plot_vpc(bin= pmx_vpc_bin( 72 | style = "fixed", 73 | fixedBreaks=c(-10,2, 5, 10,15,50)) 74 | ) 75 | 76 | # example with legend 77 | 78 | ctr \%>\% pmx_plot_vpc( 79 | is.legend = TRUE, 80 | pi = pmx_vpc_pi(interval=c(0.02,0.98),median = list(linetype="dotted")), 81 | ci = pmx_vpc_ci(interval = c(0.05,0.95),median=list(fill="red")) 82 | ) 83 | 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /man/pmx_theme.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-themes.R 3 | \name{pmx_theme} 4 | \alias{pmx_theme} 5 | \title{Define ggPMX theme} 6 | \usage{ 7 | pmx_theme(...) 8 | } 9 | \arguments{ 10 | \item{...}{can contain any valid argument of \code{ggplot2} \code{\link[ggplot2]{theme}} 11 | object.} 12 | } 13 | \description{ 14 | This theme is a simple wrapper gdoc theme 15 | from ggthems package. 16 | } 17 | -------------------------------------------------------------------------------- /man/pmx_tidyr_new_interface.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_utils_nonmem_reader.R 3 | \name{pmx_tidyr_new_interface} 4 | \alias{pmx_tidyr_new_interface} 5 | \title{Check tidyr version} 6 | \usage{ 7 | pmx_tidyr_new_interface() 8 | } 9 | \value{ 10 | the package version of tidyr 11 | } 12 | \description{ 13 | Check the version of tidyr to handle the gap between v0.8.3 and v1.0.0 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/pmx_update.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-filter.R 3 | \name{pmx_update} 4 | \alias{pmx_update} 5 | \title{Update plot object} 6 | \usage{ 7 | pmx_update( 8 | ctr, 9 | pname, 10 | strat.color = NULL, 11 | strat.facet = NULL, 12 | color.scales = NULL, 13 | filter = NULL, 14 | trans = NULL, 15 | ..., 16 | pmxgpar = NULL 17 | ) 18 | } 19 | \arguments{ 20 | \item{ctr}{\code{pmxClass} controller object} 21 | 22 | \item{pname}{character the plot name to update} 23 | 24 | \item{strat.color}{\code{character} optional stratification parameter} 25 | 26 | \item{strat.facet}{\code{formula} optional stratification parameter} 27 | 28 | \item{color.scales}{\code{list} can be used with strat.color to set scale_color_manual 29 | \code{\link{pmx_gpar}} function.} 30 | 31 | \item{filter}{optional filter which will be applied to plotting data} 32 | 33 | \item{trans}{\code{character} define the transformation to apply on x or y or both variables} 34 | 35 | \item{...}{others graphical parameters given to set the plot} 36 | 37 | \item{pmxgpar}{a object of class pmx_gpar possibly the output of the} 38 | } 39 | \value{ 40 | controller object with the plot updated 41 | } 42 | \description{ 43 | Update plot object 44 | } 45 | \details{ 46 | \strong{trans} is a transformation that user can apply to x, or y coordinates. The transformation 47 | is applied to the data before the plotting. This gives more felxiblilty to the user and also conserves 48 | all static positions like annotations ( draft specially) 49 | 50 | For example: 51 | 52 | var_x apply variance to x coordinates the variance function 53 | 54 | var_xy apply variance to both 55 | This mechanism is applied internally to scale log. 56 | } 57 | \seealso{ 58 | Other pmxclass: 59 | \code{\link{get_cats}()}, 60 | \code{\link{get_conts}()}, 61 | \code{\link{get_covariates}()}, 62 | \code{\link{get_data}()}, 63 | \code{\link{get_occ}()}, 64 | \code{\link{get_plot_config}()}, 65 | \code{\link{get_plot}()}, 66 | \code{\link{get_strats}()}, 67 | \code{\link{plot_names}()}, 68 | \code{\link{plots}()}, 69 | \code{\link{set_data}()}, 70 | \code{\link{set_plot}()} 71 | } 72 | \concept{pmxclass} 73 | -------------------------------------------------------------------------------- /man/pmx_update_extension.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx_utils_nonmem_reader.R 3 | \name{pmx_update_extension} 4 | \alias{pmx_update_extension} 5 | \title{Update file extension} 6 | \usage{ 7 | pmx_update_extension(x, ext) 8 | } 9 | \arguments{ 10 | \item{x}{A string or vector of strings containing the file name to be modified.} 11 | 12 | \item{ext}{A string or vector of strings containing the name of the new extension(s).} 13 | } 14 | \value{ 15 | A string or vector of strings of file name(s). 16 | } 17 | \description{ 18 | Change the extension of a file. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/pmx_vpc.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-vpc.R 3 | \name{pmx_vpc} 4 | \alias{pmx_vpc} 5 | \title{Creates vpc object} 6 | \usage{ 7 | pmx_vpc( 8 | type = c("percentile", "scatter"), 9 | idv = "TIME", 10 | obs = pmx_vpc_obs(), 11 | pi = pmx_vpc_pi(), 12 | ci = pmx_vpc_ci(), 13 | rug = pmx_vpc_rug(), 14 | bin = pmx_vpc_bin(), 15 | labels = NULL, 16 | facets = NULL, 17 | is.legend = TRUE, 18 | is.footnote = TRUE, 19 | dname = NULL, 20 | ... 21 | ) 22 | } 23 | \arguments{ 24 | \item{type}{\code{charcater} can be either percentile or scatter} 25 | 26 | \item{idv}{\code{chracater} individual variable} 27 | 28 | \item{obs}{\code{pmx_vpc_obs} object observation layer \link{pmx_vpc_obs}} 29 | 30 | \item{pi}{\code{pmx_vpc_pi} object percentile layer \link{pmx_vpc_pi}} 31 | 32 | \item{ci}{\code{pmx_vpc_ci} object confidence interval layer \link{pmx_vpc_ci}} 33 | 34 | \item{rug}{\code{pmx_vpc_rug} object rug layer \link{pmx_vpc_rug}} 35 | 36 | \item{bin}{\code{pmx_vpc_bin} object \link{pmx_vpc_bin}} 37 | 38 | \item{labels}{\code{list} define title and axis labels} 39 | 40 | \item{facets}{is a list of parameters passed to facet_wrap in case of startification} 41 | 42 | \item{is.legend}{\code{logical} if TRUE add legend} 43 | 44 | \item{is.footnote}{\code{logical} if TRUE add footnote} 45 | 46 | \item{dname}{added for compatibility with other ggPMX plots} 47 | 48 | \item{...}{extra parameters passed to base graphical parameters} 49 | } 50 | \description{ 51 | Creates vpc object 52 | } 53 | \seealso{ 54 | Other vpc: 55 | \code{\link{pmx_plot_vpc}()}, 56 | \code{\link{pmx_vpc_bin}()}, 57 | \code{\link{pmx_vpc_ci}()}, 58 | \code{\link{pmx_vpc_obs}()}, 59 | \code{\link{pmx_vpc_pi}()}, 60 | \code{\link{pmx_vpc_rug}()} 61 | } 62 | \concept{vpc} 63 | -------------------------------------------------------------------------------- /man/pmx_vpc_bin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-vpc.R 3 | \name{pmx_vpc_bin} 4 | \alias{pmx_vpc_bin} 5 | \title{Creates vpc bins} 6 | \usage{ 7 | pmx_vpc_bin(style, within_strat = TRUE, seed = 42, ...) 8 | } 9 | \arguments{ 10 | \item{style}{\code{character} style chosen on of the:\cr 11 | "fixed", "sd", "equal", "pretty", "quantile", "kmeans", "hclust" or "jenks"} 12 | 13 | \item{within_strat}{\code{logical} if TRUE compute the bining for each strat level. \cr 14 | By default t is false and bining are equal for all stratifications levels.} 15 | 16 | \item{seed}{\code{integer} used in \code{set.seed} call to ensure \cr 17 | reproducibility if style is "kmeans". Set to NULL if this \cr 18 | is not desired.} 19 | 20 | \item{...}{other classInt::classIntervals parameters excpet \code{style} and \code{n}} 21 | } 22 | \description{ 23 | Creates vpc bins 24 | } 25 | \details{ 26 | This is a wrapper to the bin based VPC 27 | } 28 | \seealso{ 29 | Other vpc: 30 | \code{\link{pmx_plot_vpc}()}, 31 | \code{\link{pmx_vpc_ci}()}, 32 | \code{\link{pmx_vpc_obs}()}, 33 | \code{\link{pmx_vpc_pi}()}, 34 | \code{\link{pmx_vpc_rug}()}, 35 | \code{\link{pmx_vpc}()} 36 | } 37 | \concept{vpc} 38 | -------------------------------------------------------------------------------- /man/pmx_vpc_ci.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-vpc.R 3 | \name{pmx_vpc_ci} 4 | \alias{pmx_vpc_ci} 5 | \title{Sets vpc confidence interval layer} 6 | \usage{ 7 | pmx_vpc_ci( 8 | show = c("all", "median"), 9 | interval = c(0.025, 0.975), 10 | method = c("ribbon", "rectangle"), 11 | median = list(fill = "red", alpha = 0.3), 12 | extreme = list(fill = "#3388cc", alpha = 0.3) 13 | ) 14 | } 15 | \arguments{ 16 | \item{show}{\code{charcater} how areas are displayed: 17 | \itemize{ 18 | \item \strong{show="all"} areas will be displayed for each of the 3 percentiles. 19 | \item \strong{show="median"} Show only median area. 20 | }} 21 | 22 | \item{interval}{\code{numeric} quantiles values default to \code{c(.05,.95)}} 23 | 24 | \item{method}{\code{charcater} which areas are displayed: 25 | \itemize{ 26 | \item \strong{method="ribbon"} areas are ribbons. 27 | \item \strong{method="rectangle"} areas are horizontal rectangles. 28 | }} 29 | 30 | \item{median}{\code{list} containing: \cr 31 | \itemize{ 32 | \item \strong{fill} \code{character} Color of the area representing the CI for the median. Default: "#3388cc". 33 | \item \strong{alpha} \code{numeric} Transparency of the area representing the PI for the median. Default=0.3. 34 | }} 35 | 36 | \item{extreme}{\code{list} containing: \cr 37 | \itemize{ 38 | \item \strong{fill} \code{character} Color of the area representing the CI for the extreme percentiles. Default: "#3388cc". 39 | \item \strong{alpha} \code{numeric} Transparency of the area representing the PI for the extreme percentiles. Default=0.3. 40 | }} 41 | } 42 | \description{ 43 | Sets vpc confidence interval layer 44 | } 45 | \seealso{ 46 | Other vpc: 47 | \code{\link{pmx_plot_vpc}()}, 48 | \code{\link{pmx_vpc_bin}()}, 49 | \code{\link{pmx_vpc_obs}()}, 50 | \code{\link{pmx_vpc_pi}()}, 51 | \code{\link{pmx_vpc_rug}()}, 52 | \code{\link{pmx_vpc}()} 53 | } 54 | \concept{vpc} 55 | -------------------------------------------------------------------------------- /man/pmx_vpc_obs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-vpc.R 3 | \name{pmx_vpc_obs} 4 | \alias{pmx_vpc_obs} 5 | \title{Sets vpc observation layer} 6 | \usage{ 7 | pmx_vpc_obs(show = TRUE, color = "#000000", size = 1, alpha = 0.7, shape = 1) 8 | } 9 | \arguments{ 10 | \item{show}{\code{logical} if TRUE show observation points} 11 | 12 | \item{color}{\code{character} Color of the observed endpoint values. Default: "#000000".} 13 | 14 | \item{size}{\code{numeric} Size of the observed endpoint values. Default: 1.} 15 | 16 | \item{alpha}{\code{numeric} Transparency of the observed endpoint values. Default: 0.7.} 17 | 18 | \item{shape}{\code{numeric} Shape of the observed endpoint values. Default: 1.} 19 | } 20 | \description{ 21 | Sets vpc observation layer 22 | } 23 | \seealso{ 24 | Other vpc: 25 | \code{\link{pmx_plot_vpc}()}, 26 | \code{\link{pmx_vpc_bin}()}, 27 | \code{\link{pmx_vpc_ci}()}, 28 | \code{\link{pmx_vpc_pi}()}, 29 | \code{\link{pmx_vpc_rug}()}, 30 | \code{\link{pmx_vpc}()} 31 | } 32 | \concept{vpc} 33 | -------------------------------------------------------------------------------- /man/pmx_vpc_pi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-vpc.R 3 | \name{pmx_vpc_pi} 4 | \alias{pmx_vpc_pi} 5 | \title{Sets vpc percentile layer} 6 | \usage{ 7 | pmx_vpc_pi( 8 | show = c("all", "median", "area"), 9 | interval = c(0.05, 0.95), 10 | median = list(color = "#000000", linewidth = 1, alpha = 0.7, linetype = "solid"), 11 | extreme = list(color = "#000000", linewidth = 1, alpha = 0.7, linetype = "dashed"), 12 | area = list(fill = "blue", alpha = 0.1) 13 | ) 14 | } 15 | \arguments{ 16 | \item{show}{\code{charcater} how lines are displayed: 17 | \itemize{ 18 | \item \strong{show=all} lines will be displayed for each of 19 | the 3 percentiles. with a shaded area. 20 | \item \strong{show=median} Show only median line. 21 | \item \strong{show=area} Show only median line and the shaded area 22 | }} 23 | 24 | \item{interval}{\code{numeric} quantiles values default 25 | to \code{c(.05,.95)}} 26 | 27 | \item{median}{\code{list} containing: \cr 28 | \itemize{ 29 | \item \strong{color} \code{charcater} Color of the median percentile line. Default: "#000000". 30 | \item \strong{linewidth} \code{numeric} Thickness of the median percentile line. Default: 1. 31 | \item \strong{alpha} \code{numeric} Transparency of the median percentile line. Default: 0.7. 32 | \item \strong{linetype} \code{charcater} Linetype of the median percentile line. Default: "solid". 33 | }} 34 | 35 | \item{extreme}{\code{list} containing: \cr 36 | \itemize{ 37 | \item \strong{color} \code{charcater} Color of the median percentile line. Default: "#000000". 38 | \item \strong{linewidth} \code{numeric} Thickness of the median percentile line. Default: 1. 39 | \item \strong{alpha} \code{numeric} Transparency of the median percentile line. Default: 0.7. 40 | \item \strong{linetype} \code{charcater} Linetype of the median percentile line. Default: "solid" 41 | }} 42 | 43 | \item{area}{\code{list} containing: \cr 44 | \itemize{ 45 | \item \strong{fill} \code{charcater} Color of the shaded area. Default: "blue". 46 | \item \strong{alpha} \code{numeric} Transparency of the sahded area. Default: 0.1. 47 | }} 48 | } 49 | \description{ 50 | Sets vpc percentile layer 51 | } 52 | \seealso{ 53 | Other vpc: 54 | \code{\link{pmx_plot_vpc}()}, 55 | \code{\link{pmx_vpc_bin}()}, 56 | \code{\link{pmx_vpc_ci}()}, 57 | \code{\link{pmx_vpc_obs}()}, 58 | \code{\link{pmx_vpc_rug}()}, 59 | \code{\link{pmx_vpc}()} 60 | } 61 | \concept{vpc} 62 | -------------------------------------------------------------------------------- /man/pmx_vpc_rug.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-vpc.R 3 | \name{pmx_vpc_rug} 4 | \alias{pmx_vpc_rug} 5 | \title{Sets vpc rug layer} 6 | \usage{ 7 | pmx_vpc_rug(show = TRUE, color = "#000000", linewidth = 1, alpha = 0.7, size) 8 | } 9 | \arguments{ 10 | \item{show}{\code{logical} If TRUE show bin separators} 11 | 12 | \item{color}{\code{character} Color of the rug. Default: "#000000".} 13 | 14 | \item{linewidth}{\code{numeric} Thickness of the rug. Default: 1.} 15 | 16 | \item{alpha}{\code{numeric} Transparency of the rug. Default: 0.7.} 17 | 18 | \item{size}{\code{numeric} Depreciated thickness of the rug. Default: 1.} 19 | } 20 | \description{ 21 | Sets vpc rug layer 22 | } 23 | \details{ 24 | When the vpc confidence interval layer method is rectangles we don't show rug separators. 25 | } 26 | \seealso{ 27 | Other vpc: 28 | \code{\link{pmx_plot_vpc}()}, 29 | \code{\link{pmx_vpc_bin}()}, 30 | \code{\link{pmx_vpc_ci}()}, 31 | \code{\link{pmx_vpc_obs}()}, 32 | \code{\link{pmx_vpc_pi}()}, 33 | \code{\link{pmx_vpc}()} 34 | } 35 | \concept{vpc} 36 | -------------------------------------------------------------------------------- /man/print.abbreviation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{print.abbreviation} 4 | \alias{print.abbreviation} 5 | \title{S3 print abbreviation} 6 | \usage{ 7 | \method{print}{abbreviation}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{object of class configs} 11 | 12 | \item{...}{pass additional options (not used presently)} 13 | } 14 | \value{ 15 | print abbreviation 16 | } 17 | \description{ 18 | S3 print abbreviation 19 | } 20 | -------------------------------------------------------------------------------- /man/print.configs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/config.R 3 | \name{print.configs} 4 | \alias{print.configs} 5 | \title{This function can be used to print configuration of the defined object using S3 method.} 6 | \usage{ 7 | \method{print}{configs}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{object of class configs} 11 | 12 | \item{...}{pass additional options (not used presently)} 13 | } 14 | \value{ 15 | print result 16 | } 17 | \description{ 18 | This function can be used to print configuration of the defined object using S3 method. 19 | } 20 | -------------------------------------------------------------------------------- /man/print.pmxClass.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{print.pmxClass} 4 | \alias{print.pmxClass} 5 | \title{Print pmxClass object} 6 | \usage{ 7 | \method{print}{pmxClass}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{pmxClass object} 11 | 12 | \item{...}{additinal arguments to pass to print} 13 | } 14 | \value{ 15 | print object to screen 16 | } 17 | \description{ 18 | Print pmxClass object 19 | } 20 | \concept{pmxclass functions} 21 | -------------------------------------------------------------------------------- /man/print.pmxConfig.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/config.R 3 | \name{print.pmxConfig} 4 | \alias{print.pmxConfig} 5 | \title{S3 method print pmxConfig object} 6 | \usage{ 7 | \method{print}{pmxConfig}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{pmxConfig object} 11 | 12 | \item{...}{addtional arguments to pass to print (unused currently)} 13 | } 14 | \value{ 15 | invisible object 16 | } 17 | \description{ 18 | S3 method print pmxConfig object 19 | } 20 | -------------------------------------------------------------------------------- /man/print.pmx_gpar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gpar.R 3 | \name{print.pmx_gpar} 4 | \alias{print.pmx_gpar} 5 | \title{Print pmx_gpar object} 6 | \usage{ 7 | \method{print}{pmx_gpar}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{pmx_gpar object} 11 | 12 | \item{...}{argument passed to print ( to satisfy generic)} 13 | } 14 | \value{ 15 | a character description of graphical parameters 16 | } 17 | \description{ 18 | Print pmx_gpar object 19 | } 20 | -------------------------------------------------------------------------------- /man/read_extfile.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/read_extfile.R 3 | \name{read_extfile} 4 | \alias{read_extfile} 5 | \title{Reads .ext files generated by NONMEM} 6 | \usage{ 7 | read_extfile( 8 | run = NA_real_, 9 | project = getwd(), 10 | file = paste0(run, ".ext"), 11 | path = NULL, 12 | read_fun = c("data.table", "read.table"), 13 | quiet 14 | ) 15 | } 16 | \arguments{ 17 | \item{run}{run a run number or run identifier} 18 | 19 | \item{project}{project the NONMEM project directory} 20 | 21 | \item{file}{file the `ext` file name} 22 | 23 | \item{path}{path full path and file name for `ext` file} 24 | 25 | \item{read_fun}{read_fun function to read the `ext` file} 26 | 27 | \item{quiet}{Logical, if \code{FALSE} messages are printed to the console.} 28 | } 29 | \value{ 30 | A list with param, omega, and sigma in a format 31 | ready to be used. 32 | } 33 | \description{ 34 | Reads .ext files generated by NONMEM 35 | } 36 | \examples{ 37 | #project <- system.file("nonmem", package = "mrgsolve") 38 | #est <- read_nmext(1005, project = project) 39 | } 40 | \author{ 41 | This function is based on read_nmext from mrgsolve, Original Author: Kyle T Baron. 42 | This function has some changes to the original code: 43 | Addition of param, "quiet", (option of pmx_msg function, from xpose package) (Line: 27) 44 | The code was slightly adjusted to check for multiple tables and also extract SE (ITERATION == 1000000001) (Line: 44-58, Line: 86-96, respectively) 45 | The output was also slightly adjusted to fit ggPMX output (df and df2) (Line: 105,106) 46 | as_bmat was replaced by bmat_like to create the diagonal matrix (Line 116:142) 47 | } 48 | -------------------------------------------------------------------------------- /man/read_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-reader.R 3 | \name{read_input} 4 | \alias{read_input} 5 | \title{Read Modelling input data} 6 | \usage{ 7 | read_input( 8 | ipath, 9 | dv, 10 | dvid, 11 | cats = "", 12 | conts = "", 13 | strats = "", 14 | occ = "", 15 | endpoint = NULL, 16 | id = NULL, 17 | time = NULL 18 | ) 19 | } 20 | \arguments{ 21 | \item{ipath}{full path of the input file} 22 | 23 | \item{dv}{\code{character} the name of measurable variable used in the input modelling file} 24 | 25 | \item{dvid}{\code{character} observation type parameter} 26 | 27 | \item{cats}{\emph{[Optional]}\code{character} vector of categorical covariates} 28 | 29 | \item{conts}{\emph{[Optional]}\code{character} vector of continuous covariates} 30 | 31 | \item{strats}{\emph{[Optional]}\code{character} extra stratification variables} 32 | 33 | \item{occ}{\emph{[Optional]}\code{character} inter individual occasion variables} 34 | 35 | \item{endpoint}{\code{integer} null in case of a single endpoint otherwise the index of endpoints.} 36 | 37 | \item{id}{\code{character} the name of identifier variable used in the input modelling file.} 38 | 39 | \item{time}{\code{character} the name of time variable used in the input modelling file} 40 | } 41 | \value{ 42 | data.table well formatted containing modelling input data 43 | } 44 | \description{ 45 | Read Modelling input data 46 | } 47 | -------------------------------------------------------------------------------- /man/read_mlx_ind_est.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-reader.R 3 | \name{read_mlx_ind_est} 4 | \alias{read_mlx_ind_est} 5 | \title{Read MONOLIX individual parameters} 6 | \usage{ 7 | read_mlx_ind_est(path, x, ...) 8 | } 9 | \arguments{ 10 | \item{path}{character path to the file} 11 | 12 | \item{x}{dataset object} 13 | 14 | \item{...}{extra parameter not used} 15 | } 16 | \value{ 17 | data.table object 18 | } 19 | \description{ 20 | Read MONOLIX individual parameters 21 | } 22 | -------------------------------------------------------------------------------- /man/read_mlx_par_est.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-reader.R 3 | \name{read_mlx_par_est} 4 | \alias{read_mlx_par_est} 5 | \title{Read MONOLIX parameter estimation file} 6 | \usage{ 7 | read_mlx_par_est(path, x, ...) 8 | } 9 | \arguments{ 10 | \item{path}{character path to the file} 11 | 12 | \item{x}{dataset object} 13 | 14 | \item{...}{extra parameter not used} 15 | } 16 | \value{ 17 | data.table object 18 | } 19 | \description{ 20 | Read MONOLIX parameter estimation file 21 | } 22 | -------------------------------------------------------------------------------- /man/read_mlx_pred.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmx-reader.R 3 | \name{read_mlx_pred} 4 | \alias{read_mlx_pred} 5 | \title{Read MONOLIX model predictions} 6 | \usage{ 7 | read_mlx_pred(path, x, ...) 8 | } 9 | \arguments{ 10 | \item{path}{character path to the file} 11 | 12 | \item{x}{dataset object} 13 | 14 | \item{...}{extra parameter not used} 15 | } 16 | \value{ 17 | data.table object 18 | } 19 | \description{ 20 | Read MONOLIX model predictions 21 | } 22 | -------------------------------------------------------------------------------- /man/reexports.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \docType{import} 4 | \name{reexports} 5 | \alias{reexports} 6 | \alias{\%>\%} 7 | \title{Objects exported from other packages} 8 | \keyword{internal} 9 | \description{ 10 | These objects are imported from other packages. Follow the links 11 | below to see their documentation. 12 | 13 | \describe{ 14 | \item{magrittr}{\code{\link[magrittr:pipe]{\%>\%}}} 15 | }} 16 | 17 | -------------------------------------------------------------------------------- /man/residual.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-residual.R 3 | \name{residual} 4 | \alias{residual} 5 | \title{This function create a residual for each observed value and also generates a residual 6 | distribution} 7 | \usage{ 8 | residual( 9 | x, 10 | y, 11 | labels = NULL, 12 | point = NULL, 13 | is.hline = FALSE, 14 | hline = NULL, 15 | dname = NULL, 16 | facets = NULL, 17 | bloq = NULL, 18 | square_plot = TRUE, 19 | ... 20 | ) 21 | } 22 | \arguments{ 23 | \item{x}{x axis aesthetics} 24 | 25 | \item{y}{y axis aesthetics} 26 | 27 | \item{labels}{list that contain title,subtitle, axis labels} 28 | 29 | \item{point}{geom point graphical parameters} 30 | 31 | \item{is.hline}{logical if TRUE add horizontal line y=0 ( TRUE by default)} 32 | 33 | \item{hline}{geom hline graphical parameters} 34 | 35 | \item{dname}{name of dataset to be used} 36 | 37 | \item{facets}{\code{list} wrap facetting in case of strat.facet} 38 | 39 | \item{bloq}{\code{pmxBLOQ} object created by \code{\link{pmx_bloq}}} 40 | 41 | \item{square_plot}{square dv_pred plot (TRUE by default)} 42 | 43 | \item{...}{others graphics arguments passed to \code{\link{pmx_gpar}} internal object.} 44 | } 45 | \value{ 46 | a residual object 47 | } 48 | \description{ 49 | This function create a residual for each observed value and also generates a residual 50 | distribution 51 | } 52 | \details{ 53 | Some parameters are a list of parameters : 54 | 55 | \strong{point} is a list that contains: 56 | \itemize{ 57 | \item \strong{shape:} default to 1 58 | \item \strong{color:} default to black 59 | \item \strong{size:} default to 1 60 | } 61 | 62 | \strong{labels} is a list that contains: 63 | \itemize{ 64 | \item \strong{title:} plot title default to AES_X versus AES_Y 65 | \item \strong{subtitle:} plot subtitle default empty 66 | \item \strong{x:} x axis label default to AES_X 67 | \item \strong{y:} y axis label default to AES_Y 68 | } 69 | } 70 | \seealso{ 71 | \code{\link{plot_pmx.residual}} 72 | } 73 | -------------------------------------------------------------------------------- /man/set_abbrev.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{set_abbrev} 4 | \alias{set_abbrev} 5 | \title{update or add a new abbreviation} 6 | \usage{ 7 | set_abbrev(ctr, ...) 8 | } 9 | \arguments{ 10 | \item{ctr}{\code{pmxClass} controller object} 11 | 12 | \item{...}{Options to set or add, with the form \code{name = value}.} 13 | } 14 | \description{ 15 | update or add a new abbreviation 16 | } 17 | \examples{ 18 | \donttest{ 19 | ctr <- theophylline() 20 | ctr \%>\% set_abbrev("new_param" = "new value") 21 | ctr \%>\% get_abbrev("new_param") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /man/set_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{set_data} 4 | \alias{set_data} 5 | \title{Set a controller data set} 6 | \usage{ 7 | set_data(ctr, ..., envir = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{ctr}{the controller object} 11 | 12 | \item{...}{a named list parameters (see example)} 13 | 14 | \item{envir}{the \code{\link[base]{environment}} in which \code{expr} is to 15 | be evaluated. May also be \code{NULL}, a list, a data frame, 16 | a pairlist or an integer as specified to \code{\link[base]{sys.call}}.} 17 | } 18 | \description{ 19 | Set a controller data set 20 | } 21 | \details{ 22 | This function can be used to set an existing data set or to create a new one. The basic 23 | idea is to change the built-in data set (change the factor level names, change some rows 24 | values or apply any other data set operation) and use the new data set using the dname 25 | parameter of pmx_plot family functions. 26 | } 27 | \examples{ 28 | \donttest{ 29 | ctr <- theophylline() 30 | dx <- ctr \%>\% get_data("eta") 31 | dx <- dx[, EFFECT := factor( 32 | EFFECT, 33 | levels = c("ka", "V", "Cl"), 34 | labels = c("Concentration", "Volume", "Clearance") 35 | )] 36 | ## update existing data set 37 | ctr \%>\% set_data(eta = dx) 38 | ## or create a new data set 39 | ctr \%>\% set_data(eta_long = dx) 40 | } 41 | } 42 | \seealso{ 43 | Other pmxclass: 44 | \code{\link{get_cats}()}, 45 | \code{\link{get_conts}()}, 46 | \code{\link{get_covariates}()}, 47 | \code{\link{get_data}()}, 48 | \code{\link{get_occ}()}, 49 | \code{\link{get_plot_config}()}, 50 | \code{\link{get_plot}()}, 51 | \code{\link{get_strats}()}, 52 | \code{\link{plot_names}()}, 53 | \code{\link{plots}()}, 54 | \code{\link{pmx_update}()}, 55 | \code{\link{set_plot}()} 56 | } 57 | \concept{pmxclass} 58 | -------------------------------------------------------------------------------- /man/set_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmxClass.R 3 | \name{set_plot} 4 | \alias{set_plot} 5 | \title{Create a new plot of the desired type} 6 | \usage{ 7 | set_plot( 8 | ctr, 9 | ptype = c("IND", "DIS", "SCATTER", "ETA_PAIRS", "ETA_COV", "PMX_QQ", "VPC", "PMX_DENS"), 10 | pname, 11 | use.defaults = TRUE, 12 | filter = NULL, 13 | strat.color = NULL, 14 | strat.facet = NULL, 15 | color.scales = NULL, 16 | trans = NULL, 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{ctr}{\code{pmxClass} controller object} 22 | 23 | \item{ptype}{plot type can be: 24 | \itemize{ 25 | \item "IND" Individual plot type: \code{\link{individual}} 26 | \item "DIS" Distribution plot type : \code{\link{distrib}} 27 | \item "SCATTER" Residual plot type :\code{\link{residual}} 28 | }} 29 | 30 | \item{pname}{plot name, if missing it will be created using function aestetics} 31 | 32 | \item{use.defaults}{\code{logical} if FALSE do not use defaults defined in yaml init files} 33 | 34 | \item{filter}{optional filter which will be applied to plotting data} 35 | 36 | \item{strat.color}{\code{character}} 37 | 38 | \item{strat.facet}{\code{formula} define categorical stratification as formula} 39 | 40 | \item{color.scales}{\code{list} can be used with strat.color to set scale_color_manual} 41 | 42 | \item{trans}{\code{list} transformation operator} 43 | 44 | \item{...}{other plot parameters to configure \code{\link{pmx_gpar}}.} 45 | } 46 | \value{ 47 | invisible ctr object 48 | } 49 | \description{ 50 | Create a new plot of the desired type 51 | } 52 | \seealso{ 53 | Other pmxclass: 54 | \code{\link{get_cats}()}, 55 | \code{\link{get_conts}()}, 56 | \code{\link{get_covariates}()}, 57 | \code{\link{get_data}()}, 58 | \code{\link{get_occ}()}, 59 | \code{\link{get_plot_config}()}, 60 | \code{\link{get_plot}()}, 61 | \code{\link{get_strats}()}, 62 | \code{\link{plot_names}()}, 63 | \code{\link{plots}()}, 64 | \code{\link{pmx_update}()}, 65 | \code{\link{set_data}()} 66 | } 67 | \concept{pmxclass} 68 | -------------------------------------------------------------------------------- /man/sub-.pmx_gpar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gpar.R 3 | \name{[.pmx_gpar} 4 | \alias{[.pmx_gpar} 5 | \title{Method for subsetting "pmx_gpar" objects} 6 | \usage{ 7 | \method{[}{pmx_gpar}(x, index, ...) 8 | } 9 | \arguments{ 10 | \item{x}{pmx_gpar object} 11 | 12 | \item{index}{can be character/integer of element} 13 | 14 | \item{...}{other parameter (not used just for generic)} 15 | } 16 | \value{ 17 | if exists the parameter description 18 | } 19 | \description{ 20 | Method for subsetting "pmx_gpar" objects 21 | } 22 | -------------------------------------------------------------------------------- /man/theophylline.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{theophylline} 4 | \alias{theophylline} 5 | \title{Creates pmx controller using theophylline data} 6 | \usage{ 7 | theophylline(settings = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{settings}{\code{pmxSettings} object} 11 | 12 | \item{...}{other parameters of pmx_mlx like endpoint} 13 | } 14 | \value{ 15 | pmx controller 16 | } 17 | \description{ 18 | Creates pmx controller using theophylline data 19 | } 20 | \examples{ 21 | \dontrun{ 22 | theophylline() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /man/wrap_formula.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot-distribution.R 3 | \name{wrap_formula} 4 | \alias{wrap_formula} 5 | \title{merge facets formula with new formula} 6 | \usage{ 7 | wrap_formula(x, origin = "lfacet") 8 | } 9 | \arguments{ 10 | \item{x}{\code{formula} object} 11 | 12 | \item{origin}{the origin formula default to ~lfacets} 13 | } 14 | \value{ 15 | \code{formula} object 16 | } 17 | \description{ 18 | merge facets formula with new formula 19 | } 20 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(ggPMX) 3 | library(data.table) 4 | setDTthreads(1) 5 | test_check("ggPMX") 6 | -------------------------------------------------------------------------------- /tests/testthat/helper-pmxClass.R: -------------------------------------------------------------------------------- 1 | test_pmxClass_helpers <- function() { 2 | theophylline <- file.path( 3 | system.file(package = "ggPMX"), "testdata", 4 | "theophylline" 5 | ) 6 | WORK_DIR <- file.path(theophylline, "Monolix") 7 | input_file <- file.path(theophylline, "data_pk.csv") 8 | ctr <- pmx_mlx( 9 | "standing", 10 | directory = WORK_DIR, 11 | input = input_file, 12 | dv = "Y", 13 | dvid = "DVID", 14 | conts = c("WT0", "AGE0"), 15 | cats = c("SEX"), 16 | strats = c("STUD") 17 | ) 18 | list( 19 | workdir = WORK_DIR, 20 | input = input_file, 21 | ctr = ctr 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /tests/testthat/helper-reader.R: -------------------------------------------------------------------------------- 1 | 2 | reader_helpers <- function() { 3 | theophylline <- file.path( 4 | system.file(package = "ggPMX"), "testdata", 5 | "theophylline" 6 | ) 7 | WORK_DIR <- file.path(theophylline, "Monolix") 8 | input_file <- file.path(theophylline, "data_pk.csv") 9 | testconf <- load_config("standing", "mlx") 10 | list(wd = WORK_DIR, input = input_file, conf = testconf) 11 | } 12 | -------------------------------------------------------------------------------- /tests/testthat/helper-skip.R: -------------------------------------------------------------------------------- 1 | helper_skip <- function() { 2 | ret <- isTRUE(as.logical(Sys.getenv("NOT_CRAN", "false"))) 3 | #ret 4 | TRUE # don't skip for now 5 | } 6 | -------------------------------------------------------------------------------- /tests/testthat/helper-update_plots.R: -------------------------------------------------------------------------------- 1 | helper_updateplots <- function() { 2 | theophylline <- file.path( 3 | system.file(package = "ggPMX"), "testdata", 4 | "theophylline" 5 | ) 6 | WORK_DIR <- file.path(theophylline, "Monolix") 7 | input_file <- file.path(theophylline, "data_pk.csv") 8 | ctr <- pmx_mlx( 9 | config = "standing", directory = WORK_DIR, 10 | input = input_file, 11 | dv = "Y", dvid = "DVID", 12 | conts = c("WT0", "AGE0"), 13 | cats = c("SEX"), 14 | occ = "", 15 | strats = c("STUD"), 16 | settings=pmx_settings(use.titles = TRUE) 17 | ) 18 | list(ctr = ctr, wd = WORK_DIR, input = input_file) 19 | } 20 | -------------------------------------------------------------------------------- /tests/testthat/test-2023table.R: -------------------------------------------------------------------------------- 1 | if (helper_skip()) { 2 | test_that("Monolix 2023 tables read in correctly (Issue #369)", { 3 | skip_if_not(file.exists(test_path("warfarin_PD_project.zip"))) 4 | .path <- normalizePath(test_path("warfarin_PD_project.zip")) 5 | 6 | withr::with_tempdir({ 7 | 8 | unzip(.path) 9 | 10 | ctr <- pmx_mlxtran("warfarin_PD_project.mlxtran") 11 | 12 | p_ctr <- ctr %>% param_table(return_table = TRUE) 13 | 14 | Names <- c("PARAM", "VALUE", "SE", "RSE") 15 | 16 | expect_equal(names(p_ctr), Names) 17 | 18 | }) 19 | }) 20 | } 21 | -------------------------------------------------------------------------------- /tests/testthat/test-ggforce-facet-paginate.R: -------------------------------------------------------------------------------- 1 | if (helper_skip()) { 2 | context("Test spliting facet_wrap over multiple plots") 3 | 4 | #------------------- facet_wrap_paginate start -------------------------------- 5 | 6 | test_that("facet_wrap_paginate: params: nrow and ncol is not NULL 7 | result: FacetWrapPaginate", 8 | { 9 | dx <- pmx_qq("AGE0") 10 | strat.facet <- dx[["strat.facet"]] 11 | facets <- wrap_formula(strat.facet, "EFFECT") 12 | expect_true(inherits( 13 | ggforce::facet_wrap_paginate(facets, nrow = 2, ncol = 3), 14 | "FacetWrapPaginate" 15 | )) 16 | }) 17 | 18 | test_that("facet_wrap_paginate: params: ncol is not NULL and nrow is NULL 19 | result: FacetWrap", { 20 | dx <- pmx_qq("AGE0") 21 | strat.facet <- dx[["strat.facet"]] 22 | facets <- wrap_formula(strat.facet, "EFFECT") 23 | expect_true(inherits(ggforce::facet_wrap_paginate(facets, ncol = 3), "FacetWrap")) 24 | }) 25 | 26 | test_that("facet_wrap_paginate: params: nrow and ncol is NULL 27 | result: FacetWrap", { 28 | dx <- pmx_qq("AGE0") 29 | strat.facet <- dx[["strat.facet"]] 30 | facets <- wrap_formula(strat.facet, "EFFECT") 31 | expect_true(inherits(ggforce::facet_wrap_paginate(facets), "FacetWrap")) 32 | }) 33 | 34 | test_that("facet_wrap_paginate: params: ncol is NULL and nrow is not NULL 35 | result: FacetWrap", { 36 | dx <- pmx_qq("AGE0") 37 | strat.facet <- dx[["strat.facet"]] 38 | facets <- wrap_formula(strat.facet, "EFFECT") 39 | expect_true(inherits(ggforce::facet_wrap_paginate(facets, nrow = 2), "FacetWrap")) 40 | }) 41 | 42 | test_that("facet_wrap_paginate: params: all params are NULL result: error", { 43 | expect_error(ggforce::facet_wrap_paginate()) 44 | }) 45 | #------------------- facet_wrap_paginate end ---------------------------------- 46 | 47 | #------------------- n_pages start -------------------------------------------- 48 | 49 | test_that("n_pages: params: plot without pages result: NULL", { 50 | ctr <- theophylline() 51 | plot <- pmx_plot_individual(ctr, which_pages = 1) 52 | expect_true(is.null(n_pages(plot))) 53 | }) 54 | 55 | test_that("n_pages: params: no result: NULL", { 56 | expect_error(n_pages()) 57 | }) 58 | #------------------- n_pages end ---------------------------------------------- 59 | } 60 | -------------------------------------------------------------------------------- /tests/testthat/test-plot-base.R: -------------------------------------------------------------------------------- 1 | if (helper_skip()) { 2 | library(ggplot2) 3 | 4 | context("Test plot_pmx.pmx_gpar") 5 | 6 | ctr <- theophylline() 7 | labels <- list("Concentration", "Volume", "Clearance") 8 | x <- "STUD" 9 | y <- "SEX" 10 | test_that("plot_pmx.pmx_gpar: params: NULL result: missing arguments", { 11 | expect_error(plot_pmx.pmx_gpar()) 12 | }) 13 | 14 | 15 | test_that("plot_pmx.pmx_gpar: params: gpar, p; result: error class gpar is not a pmx_gpar object", { 16 | p <- ctr %>% pmx_plot_individual(trans = "log10_y") 17 | expect_error(plot_pmx.pmx_gpar(gpar = TRUE, p)) 18 | }) 19 | 20 | 21 | test_that("plot_pmx.pmx_gpar: params: gpar, p; result: error class p is not a ggplot object", { 22 | gp <- pmx_gpar( 23 | labels = NULL, 24 | discrete = TRUE, 25 | is.smooth = FALSE 26 | ) 27 | expect_error(plot_pmx.pmx_gpar(gpar = gp, p = "DIS")) 28 | }) 29 | 30 | 31 | test_that("plot_pmx.pmx_gpar: params: gpar, p; result: error class smooth is not a list or NULL", { 32 | gp <- pmx_gpar( 33 | labels = NULL, 34 | discrete = TRUE, 35 | is.smooth = FALSE 36 | ) 37 | p <- ctr %>% pmx_plot_individual(trans = "log10_y") 38 | gp$smooth <- 1 39 | expect_error(plot_pmx.pmx_gpar(gpar = gp, p)) 40 | }) 41 | 42 | 43 | test_that("plot_pmx.pmx_gpar: params: gpar, p; result: error class band is not a list or NULL", { 44 | gp <- pmx_gpar( 45 | labels = NULL, 46 | discrete = TRUE, 47 | is.smooth = FALSE 48 | ) 49 | p <- ctr %>% pmx_plot_individual(trans = "log10_y") 50 | gp$band <- 1 51 | expect_error(plot_pmx.pmx_gpar(gpar = gp, p)) 52 | }) 53 | 54 | 55 | test_that("plot_pmx.pmx_gpar: params: gpar, p; result: error class 56 | labels are not a list or NULL", { 57 | gp <- pmx_gpar( 58 | labels = NULL, 59 | discrete = TRUE, 60 | is.smooth = FALSE 61 | ) 62 | p <- ctr %>% pmx_plot_individual(trans = "log10_y") 63 | gp$labels <- 1 64 | expect_error(plot_pmx.pmx_gpar(gpar = gp, p)) 65 | }) 66 | } 67 | -------------------------------------------------------------------------------- /tests/testthat/test-plot-defaults.R: -------------------------------------------------------------------------------- 1 | if (helper_skip()) { 2 | context("Test defaults") 3 | pmxClassHelpers <- test_pmxClass_helpers() 4 | # pmx_nlmixr() 5 | 6 | test_that("pmx_plot_xx and get plot have same defaults", { 7 | ctr <- pmxClassHelpers$ctr 8 | pp <- ctr %>% plots() 9 | Map(function(pname, fname) { 10 | p1 <- do.call(fname, list(ctr = ctr)) 11 | p2 <- if (pname == "individual") { 12 | ctr %>% get_plot(pname, 1) 13 | } else { 14 | ctr %>% get_plot(pname) 15 | } 16 | p1$plot_env$mm <- NULL 17 | p2$plot_env$mm <- NULL 18 | d1 <- unlist(as.list(p1$plot_env)) 19 | d2 <- unlist(as.list(p2$plot_env)) 20 | if (!fname %in% c("pmx_plot_eta_matrix")) { 21 | expect_true(length(setdiff(d1, d2)) < 2) 22 | } 23 | }, pp$plot_name, pp$plot_function) 24 | }) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /tests/testthat/test-plot-eta-pairs.R: -------------------------------------------------------------------------------- 1 | if (helper_skip()) { 2 | 3 | library(ggPMX) 4 | library(purrr) 5 | ctr <- theophylline() 6 | 7 | context("Test plot-eta-pairs with reference lines at 0, -1.96 and 1.96") 8 | 9 | #------------------- pmx_plot_eta_matrix start ------------------------------------------ 10 | test_that("pmx_plot_eta_matrix: params: is.vreference_line, vreference_line (value by 11 | default) result: identical value of params", { 12 | p <- ctr %>% pmx_plot_eta_matrix(is.vreference_line = TRUE) 13 | expect_identical(p$plots$`Cl;Cl`$layers[[2]]$aes_params$colour, "orange") 14 | expect_identical(p$plots$`Cl;Cl`$layers[[2]]$aes_params$linetype, "longdash") 15 | expect_identical(p$plots$`V;V`$layers[[2]]$aes_params$colour, "orange") 16 | expect_identical(p$plots$`V;V`$layers[[2]]$aes_params$linetype, "longdash") 17 | expect_identical(p$plots$`ka;ka`$layers[[2]]$aes_params$colour, "orange") 18 | expect_identical(p$plots$`ka;ka`$layers[[2]]$aes_params$linetype, "longdash") 19 | }) 20 | 21 | test_that("pmx_plot_eta_matrix: params: is.vreference_line, vreference_line result: 22 | identical value of params", { 23 | p <- pmx_plot_eta_matrix( 24 | ctr, 25 | is.vreference_line = TRUE, 26 | vreference_line = list(colour = "blue", linetype = "longdash") 27 | ) 28 | 29 | expect_identical(p$plots$`Cl;Cl`$layers[[2]]$aes_params$colour, "blue") 30 | expect_identical(p$plots$`Cl;Cl`$layers[[2]]$aes_params$linetype, "longdash") 31 | expect_identical(p$plots$`V;V`$layers[[2]]$aes_params$colour, "blue") 32 | expect_identical(p$plots$`V;V`$layers[[2]]$aes_params$linetype, "longdash") 33 | expect_identical(p$plots$`ka;ka`$layers[[2]]$aes_params$colour, "blue") 34 | expect_identical(p$plots$`ka;ka`$layers[[2]]$aes_params$linetype, "longdash") 35 | }) 36 | 37 | test_that("pmx_plot_eta_matrix: params: is.vreference_line, vreference_line etc. result: 38 | lack of parameters of vreference_line", { 39 | p <- ctr %>% pmx_plot_eta_matrix(is.vreference_line = FALSE) 40 | expect_true(is_empty(p$plots$`Cl;Cl`$layers[[2]]$aes_params$colour)) 41 | expect_true(is_empty(p$plots$`Cl;Cl`$layers[[2]]$aes_params$linetype)) 42 | expect_true(is_empty(p$plots$`V;V`$layers[[2]]$aes_params$colour)) 43 | expect_true(is_empty(p$plots$`V;V`$layers[[2]]$aes_params$linetype)) 44 | expect_true(is_empty(p$plots$`ka;ka`$layers[[2]]$aes_params$colour)) 45 | expect_true(is_empty(p$plots$`ka;ka`$layers[[2]]$aes_params$linetype)) 46 | }) 47 | #------------------- pmx_plot_eta_matrix end ------------------------------------------ 48 | } 49 | -------------------------------------------------------------------------------- /tests/testthat/test-pmx-all-compute.R: -------------------------------------------------------------------------------- 1 | if (helper_skip()) { 2 | 3 | context("Test computing Shrinkage") 4 | ctr <- theophylline() 5 | ctr2 <- data.table(x = c(2, 3)) 6 | 7 | #------------------- pmx_comp_shrink start ------------------------------------ 8 | 9 | 10 | test_that("pmx_comp_shrink: params: ctr result: sd and var are calculated correctly", { 11 | expect_identical( 12 | c(0.1125175, 0.9469996, 0.7423478, 0.0579371, 0.7697818, 0.4924055), 13 | 14 | round(digits=7, as.vector( 15 | sapply(c("var", "sd"), function(n) pmx_comp_shrink(ctr, fun=n)[["SHRINK"]])) 16 | ) 17 | 18 | ) 19 | }) 20 | 21 | 22 | test_that("pmx_comp_shrink: params: ctr is controller result:data.table", { 23 | expect_true(inherits(pmx_comp_shrink(ctr = ctr), "data.table")) 24 | }) 25 | 26 | test_that("pmx_comp_shrink: params: ctr is controller 27 | result: identical structure", { 28 | expect_identical( 29 | colnames(pmx_comp_shrink(ctr = ctr)), 30 | c("EFFECT", "OMEGA", "SHRINK", "POS", "FUN") 31 | ) 32 | expect_identical( 33 | pmx_comp_shrink(ctr = ctr)[[1]], 34 | c("Cl", "V", "ka") 35 | ) 36 | comp_shr <- pmx_comp_shrink(ctr = ctr) 37 | c("Cl", "V", "ka") 38 | expect_true(is.null(comp_shr$strat.facet)) 39 | expect_true(is.null(comp_shr$strat.color)) 40 | expect_true(is.null(comp_shr$filter)) 41 | }) 42 | 43 | test_that("pmx_comp_shrink: params: ctr is controller, filter 44 | result: identical structure", { 45 | comp_shr <- pmx_comp_shrink(ctr = ctr, filter = FUN == sd) 46 | expect_true(is.null(comp_shr$filter)) 47 | }) 48 | 49 | test_that("pmx_comp_shrink: params: ctr is controller result:data.table", { 50 | expect_true(inherits(pmx_comp_shrink(ctr = ctr), "data.table")) 51 | }) 52 | 53 | test_that( 54 | "pmx_comp_shrink: params: ctr is controller and function in (var,sd) 55 | result: right structure of result data.table", 56 | { 57 | expect_true(all(sapply(pmx_comp_shrink(ctr = ctr, fun = "sd")[[5]], function(x) { 58 | x == "sd" 59 | }))) 60 | } 61 | ) 62 | 63 | test_that("pmx_comp_shrink: params: ctr is not controller result: error", { 64 | expect_error(pmx_comp_shrink(ctr = ctr2)) 65 | }) 66 | #------------------- pmx_comp_shrink end -------------------------------------- 67 | } 68 | -------------------------------------------------------------------------------- /tests/testthat/test-pmx-plots-distribution.R: -------------------------------------------------------------------------------- 1 | if (helper_skip()) { 2 | 3 | library(ggPMX) 4 | ctr <- theophylline() 5 | 6 | context("Test pmx_plot_eta_box function") 7 | 8 | #------------------- pmx_plot_eta_box start ------------------------------------------ 9 | 10 | test_that("pmx_plot_eta_box: params: ctr, ...; result: ggplot", { 11 | p <- ctr %>% pmx_plot_eta_box(shrink=list(fun="sd")) 12 | expect_true(inherits(p, "ggplot")) 13 | }) 14 | 15 | test_that("pmx_plot_eta_box: params: ctr, ...; result: error", { 16 | expect_error(ctr %>% pmx_plot_eta_box(shrink=list("sd"))) 17 | }) 18 | 19 | #------------------- pmx_plot_eta_box end ------------------------------------------ 20 | } 21 | -------------------------------------------------------------------------------- /tests/testthat/test-pmx-vpc-bin.R: -------------------------------------------------------------------------------- 1 | if (helper_skip()) { 2 | 3 | library(ggPMX) 4 | ctr <- theophylline() 5 | 6 | context("Test pmx_vpc_bin function") 7 | 8 | test_that("pmx_vpc_bin: params result: identical type", { 9 | p <- ctr %>% pmx_vpc_bin() 10 | expect_true(inherits(p, "list")) 11 | expect_identical(pmx_vpc_bin(), NULL) 12 | }) 13 | 14 | 15 | test_that("pmx_vpc_bin: params result: ", { 16 | p <- ctr %>% pmx_vpc_bin(style = "equal") 17 | styles <- c("fixed", "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "jenks") 18 | expect_true(is.element(p$style, styles)) 19 | }) 20 | 21 | 22 | test_that("pmx_vpc_bin: params result: error", { 23 | expect_error(ctr %>% pmx_vpc_bin(style = c("sd", "jenks"), within_strat = FALSE)) 24 | }) 25 | 26 | 27 | test_that("pmx_vpc_bin: params result: identical type", { 28 | p <- pmx_vpc_bin() 29 | expect_identical(p, NULL) 30 | }) 31 | } 32 | -------------------------------------------------------------------------------- /tests/testthat/test-pmx_filter.R: -------------------------------------------------------------------------------- 1 | if (helper_skip()) { 2 | 3 | context("Test filtering of controller data") 4 | pmxClassHelpers <- test_pmxClass_helpers() 5 | 6 | test_that("canFilterData", { 7 | ctr <- pmxClassHelpers$ctr 8 | expect_is(ctr, "pmxClass") 9 | oldData <- ctr$data 10 | out <- ctr %>% pmx_filter(data_set = "eta", ID <= 5) 11 | expect_gt(dim(oldData$eta[ID > 5])[1], 0L) 12 | expect_equal(dim(out$data$eta[ID > 5])[1], 0L) 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /tests/testthat/test-shrinkage.R: -------------------------------------------------------------------------------- 1 | if (helper_skip()) { 2 | 3 | context("Test shrinkage computation") 4 | pmxClassHelpers <- test_pmxClass_helpers() 5 | 6 | 7 | test_that("test shrinkage for standing config", { 8 | ctr <- pmxClassHelpers$ctr 9 | expect_is(ctr, "pmxClass") 10 | 11 | res <- ctr %>% pmx_comp_shrink() 12 | expect_is(res, "data.frame") 13 | expect_equal(colnames(res), c("EFFECT", "OMEGA", "SHRINK", "POS", "FUN")) 14 | expect_true(all(res$SHRNK < 1)) 15 | }) 16 | 17 | 18 | test_that("test shrinkage fun parameter", { 19 | ctr <- pmxClassHelpers$ctr 20 | expect_is(ctr, "pmxClass") 21 | res.var <- ctr %>% pmx_comp_shrink(fun = "var") 22 | res.sd <- ctr %>% pmx_comp_shrink(fun = "sd") 23 | expect_true(all(res.var$SHRINK > res.sd$SHRINK)) 24 | }) 25 | 26 | 27 | test_that("variance (var) is default shrinkage fun parameter", { 28 | ctr <- pmxClassHelpers[["ctr"]] 29 | expect_is(ctr, "pmxClass") 30 | 31 | lapply( 32 | c("ETA_HIST", "ETA_BOX", "ETA_MATRIX", "ETA_QQ"), 33 | function(plot) { 34 | expect_identical("var", ctr[["config"]][["plots"]][[plot]][["shrink"]][["fun"]]) 35 | } 36 | ) 37 | }) 38 | } 39 | -------------------------------------------------------------------------------- /tests/testthat/warfarin_PD_project.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/tests/testthat/warfarin_PD_project.zip -------------------------------------------------------------------------------- /vignettes/.install_extras: -------------------------------------------------------------------------------- 1 | txt$ 2 | -------------------------------------------------------------------------------- /vignettes/ggPMX-nlmixr.Rmd: -------------------------------------------------------------------------------- 1 | ++--- 2 | title: "ggPMX with nlmixr" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{ggPMX with nlmixr} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | original_crayon_enabled <- getOption("crayon.enabled") 16 | options(crayon.enabled = FALSE) 17 | ``` 18 | 19 | ```{r setup} 20 | library(ggPMX) 21 | has_nlmixr <- FALSE 22 | if (R.version$major >= 4) { 23 | library(nlmixr) 24 | has_nlmixr <- TRUE 25 | } 26 | `` 27 | 28 | It is simple to create a ggPMX controller for a nlmixr object. 29 | 30 | Using the theophylline example with a nlmixr model we have: 31 | 32 | ```{r} 33 | one.compartment <- function() { 34 | ini({ 35 | tka <- 0.45 # Log Ka 36 | tcl <- 1 # Log Cl 37 | tv <- 3.45 # Log V 38 | eta.ka ~ 0.6 39 | eta.cl ~ 0.3 40 | eta.v ~ 0.1 41 | add.sd <- 0.7 42 | }) 43 | model({ 44 | ka <- exp(tka + eta.ka) 45 | cl <- exp(tcl + eta.cl) 46 | v <- exp(tv + eta.v) 47 | d/dt(depot) = -ka * depot 48 | d/dt(center) = ka * depot - cl / v * center 49 | cp = center / v 50 | cp ~ add(add.sd) 51 | }) 52 | } 53 | if (has_nlmixr) nlmixr(one.compartment) 54 | ``` 55 | 56 | We run this model locally by: 57 | 58 | ```{r} 59 | if (has_nlmixr) { 60 | fit <- nlmixr(one.compartment, theo_sd, est="saem", control=list(print=0)) 61 | } 62 | ``` 63 | 64 | 65 | The `fit` object is a nlmixr fit; You can read it into the nlmixr 66 | controller by: 67 | 68 | ```{r} 69 | if (has_nlmixr) { 70 | fit %>% 71 | pmx_nlmixr(vpc = FALSE) -> ## VPC is turned on by default, can turn off. 72 | ctr ## Assigned to controller 73 | } 74 | ``` 75 | 76 | Once the controller is created, you can of course have the same types 77 | of diagnostic plots as the standard ggPMX package; Using the same 78 | examples as the user manual: 79 | 80 | ```{r} 81 | if (has_nlmixr) { 82 | ctr %>% pmx_plot_dv_pred 83 | ctr %>% pmx_plot_npde_time 84 | ctr %>% pmx_plot_vpc 85 | ctr %>% pmx_plot_eta_box 86 | ctr %>% pmx_plot_eta_matrix( 87 | shrink=pmx_shrink(size=3,hjust=1.5)) 88 | } 89 | ``` 90 | 91 | This shows the standard plots for theophylline 92 | 93 | ```{r, include = FALSE} 94 | options(crayon.enabled = original_crayon_enabled) 95 | ``` 96 | -------------------------------------------------------------------------------- /vignettes/ggPMX_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ggPMXdevelopment/ggPMX/390a804782bd5c58d74e66bb51f52e42f02f5dfd/vignettes/ggPMX_arch.png --------------------------------------------------------------------------------