Learn R Programming

xpose.xtras

Introduction

This package adds some extra functionality and plots to the xpose framework. This includes some plots that have been missing in translation from xpose4, but also some useful features that truly extend the capabilities of what can be done with xpose.

There are a few bugfixes here and functionality which could easily be suggested as pull requests to the parent package. Given the size and broad use of xpose, it appears even minor pull requests take some time to implement. As such, this package implements those features directly and if at any point in the future these are added (perhaps in a better state) to the parent package, they will be deprecated if this package is in active use.

For those wondering, conflicted is used to manage bugfix conflicts, so users should be comfortable loading packages in any order.

Installation

The package can be installed from CRAN:

install.packages("xpose.xtras")

The typical github installation will also work.

pak::pak("jprybylski/xpose.xtras")

The main github branch is reserved for CRAN release-ready versions. The dev branch is usually ahead if there is active development.

pak::pkg_install("jprybylski/xpose.xtras@dev")

Preview

The grandparent package, xpose4, used to have a nice collection of figures and documentation that is referred to as a “bestiarium”. The documentation site for this package serves as a complete bestiary, but see the uncommented examples below as a sort of menagerie. There is no assumption that these examples are self-explanatory, but hopefully users familiar with xpose will recognize the new (and renewed) tools made available by this package.

EBEs versus covariates

described <- xpdb_x %>%
  set_var_labels(AGE="Age", MED1 = "Digoxin", .problem = 1) %>%
  set_var_units(AGE="yrs")  %>%
  set_var_levels(SEX=lvl_sex(), MED1 = lvl_bin())
eta_vs_contcov(described,etavar=ETA1, quiet=TRUE)
#> `geom_smooth()` using formula = 'y ~ x'
eta_vs_catcov(described,etavar=ETA1, quiet=TRUE)

Shark plots

pheno_set %>%
  focus_qapply(backfill_iofv) %>%
  dofv_vs_id(run6, run9, quiet = TRUE)

Categorical DVs

pkpd_m3 %>%
  set_var_types(catdv=BLQ,dvprobs=LIKE) %>%
  set_dv_probs(1, 1~LIKE, .dv_var = BLQ) %>%
  set_var_levels(1, BLQ = lvl_bin()) %>%
  catdv_vs_dvprobs(quiet=TRUE)
#> `geom_smooth()` using method = 'gam' and formula = 'y ~ s(x, bs = "cs")'
nlmixr2_m3 %>%
  set_var_types(catdv=CENS,dvprobs=BLQLIKE) %>%
  set_dv_probs(1, 1~BLQLIKE, .dv_var = CENS) %>%
  set_var_levels(1, CENS = lvl_bin()) %>%
  roc_plot(quiet = TRUE)

Copy Link

Version

Install

install.packages('xpose.xtras')

Monthly Downloads

393

Version

0.1.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

John Prybylski

Last Published

December 1st, 2025

Functions in xpose.xtras (0.1.2)

filter.xpose_set

Filtration method for xpose_set
get_prm

Access model parameters
fill_prob_subprob_method

Place .problem, .subprob and .method into environment consistently
franken_prop

Combine a property from all components of a franken_xpdb
iofv_vs_mod

Objective function changes across models
is_xp_xtras

Basic class checker for xp_xtras
as_leveler

Level-defining helper functions
get_prop

Generic function to extract a property from a model summary
eta_grid

Grid plots
get_prm_nlmixr2

get_prm equivalent for nlmixr2 fits
ind_roc

Individual ROC plots
%p%

Binary check if LHS is parent of LHS
grab_xpose_plot

Grab processed xpose_plot
modify_xpdb

Add, remove or rename variables in an xpdb
mutate.xpose_set

Mutation method for xpose_set
mutate_prm

Transform parameter values in place
irep

Add simulation counter
dv_vs_ipred_modavg

Model average plots
modavg_xpdb

Create a model-averaged xpose data object
mutate_files

Mutate the file table for an xpose data object
get_index

Get full index for xpose_data data
expose_property

Expose a property of xpdb objects in an xpose_set
list_vars

Updates to list_vars
list_dv_probs

For a categorical DV variable, show associated probabilities
expose_param

Expose a model parameter of xpdb objects in an xpose_set
pheno_saem

An xp_xtras example of a final model
pkpd_m3_df

An xp_xtras example of an M3 model (dataset)
pheno_final

An xp_xtras example of a final model
pheno_set

A more complex example of xpose_set object
%>%

Pipe operator
nlmixr2_as_xtra

Convenience function for ingesting an nlmixr2 model to xpose and xpose.xtras
nlmixr2_prm_associations

Based on associations baked into nlmixr2, automatically add to xpose data
pheno_base

An xp_xtras example of a base model
pkpd_m3

An xp_xtras example of an M3 model
print.xpose_plot

Draw an xpose_plot object
nlmixr2_warfarin

An xp_xtra example based on a complex nlmixr2 fit
reshape_set

Convert xpose_set to a nested list.
reportable_digits

Reportable digits for model fit
reexports

Objects exported from other packages
get_shk

Get shrinkage estimates from model summary
roc_by_mod

ROC curve across models
roc_plot

ROC Plot for categorical DVs
ipred_vs_ipred

Compare model predictions
rename.xpose_set

Renaming method for xpose_set
proc_levels

Convert levels list into tibble
param_selector

Select parameter row number
nlmixr2_m3

An xp_xtra example based on a nlmixr2 fit with M3 censoring
set_base_model

Base model for xpose_set
set_var_types

Set variable types
set_var_levels

Set variable levels
set_dv_probs

Set probability columns for categorical endpoints
set_prop

Set a summary property
set_option

Set an xpose option
two_set_dots

Typical processing for plots of 2 sets
test_xpdb

Logical instead of exception for xpose data check
set_var_types_x

Set variable types
test_nlmixr2_has_fit

Test if xpose data object has a fit object
test_nlmixr2_is_old_fit

Test if nlmixr2 fit is from an old rxode2 version
select.xpose_set

Selection method for xpose_set
select_subset

Convenience wrapper for tidyselect
summarise_xpdb

Group/ungroup and summarize variables in an xpdb
shark_plot

Individual contributions to dOFV
xpdb_nlmixr2_old

Old nlmixr2 test object for backward compatibility detection
xpdb_nlmixr2

An xp_xtra example based on an nlmixr2 fit
pull.xpose_set

Pulling method for xpose_set
xp4_xtra_theme

Updated version of the xpose4 theme
xp_var

xp_var Method
set_var_types.xp_xtras

Set variable types
set_var_types.default

Set variable types
wrap_xp_ggally

Ensure consistent style with GGally functions
val2lvl

Translate values to levels
prm_waterfall

Specific waterfall plots
xplot_boxplot

Default xpose boxplot function
xplot_pairs

Wrapper around ggpairs
vismo_pomod

An xp_xtras example of the proportional odds categorical vismodegib model
xp_xtra_theme

Extra theme defaults
as_xpdb_x

Convert an object to an xpose_data and xp_xtras object
shark_colors

Change colors of shark plots
xset_waterfall

Waterfall plot
vismo_dtmm

An xp_xtras example of the discrete-time Markov model of categorical vismodegib data
vismodegib

A tibble of mock data used for fitting vismodegib models
xpose_set

Generate a set of xpdb objects
xset_lineage

Determine lineage within a set
xpdb_set

An example xpose_set object
xplot_rocplot

Default xpose ROC plot function
xpose.xtras-package

xpose.xtras: Extra Functionality for the 'xpose' Package
xpdb_x

An example xp_xtras object
check_levels

Verify validity of level list
add_xpdb

Add one or more xpdb objects to an xpose_set
catdv_vs_dvprobs

Non-simulation based likelihood model diagnostic
check_xpose_set

Check an xpose_set object
attach_nlmixr2

Attach nlmixr2 fit object to xpose data object
add_prm_association

Describe parameter associations
add_relationship

Add relationship(s) to an xpose_set
backfill_nlmixr2_props

Populate some properties from nlmixr2 fit
backfill_iofv

Add individual objective function to data
confmatr_by_threshold

Calculate all binary confusion matrix indices
eta_vs_contcov

Eta continuous covariate plots (typical)
eta_vs_catcov

Eta categorical covariate plots (typical)
derive_prm

Derive full parameter set for mammillary PK model
duplicated.xpose_set

Check if any xpose_data objects are repeated in xpose_set
is_formula_list

Convenience functions used in package
edit_xpose_data

Master xpdb editing function
diagram_lineage

Visualize xpose_set
diff.xpose_set

Display deltaOFV values across xpose_set
diagnose_constants

Check for potential parameterization issues
desc_from_comments

Backfill utility for descriptions
focus_xpdb

Focus on an xpdb object in an xpose_set
franken_xpdb

Combine several xpose_data objects into one