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.

Load library(xpose) before library(xpose.xtras) so these bugfixes take effect via normal masking. If you use conflicted to manage namespace conflicts, load order stops mattering for them: xpose.xtras automatically registers its preferred side of these specific xpose/stats overrides. Conflicts against other, unrelated packages (e.g. another package’s own dplyr verb) aren’t affected by this and are still yours to resolve as usual (e.g. conflicted::conflicts_prefer()).

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)

Parameter correlation matrix

cormat(xpdb_x, quiet = TRUE)

Copy Link

Version

Install

install.packages('xpose.xtras')

Monthly Downloads

260

Version

0.2.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

John Prybylski

Last Published

September 1st, 2026

Functions in xpose.xtras (0.2.2)

is_formula_list

Convenience functions used in package
check_levels

Verify validity of level list
cov_forest

Covariate effect forest plot
cormat

Parameter correlation/covariance matrix heatmap
check_xpose_set

Check an xpose_set object
derive_prm

Derive full parameter set for mammillary PK model
catdv_vs_occ

Longitudinal binned observed vs. predicted plot for categorical DVs
catdv_vs_dvprobs

Non-simulation based likelihood model diagnostic
catdv_vs_ipred

Binned calibration plot for categorical DVs
confmatr_by_threshold

Calculate all binary confusion matrix indices
diagram_lineage

Visualize xpose_set
diff.xpose_set

Display deltaOFV values across xpose_set
eta_vs_contcov

Eta continuous covariate plots (typical)
derive_shk

Derive per-individual contribution to eta shrinkage
eta_vs_catcov

Eta categorical covariate plots (typical)
diagnose_constants

Check for potential parameterization issues
desc_from_comments

Backfill utility for descriptions
expose_param

Expose a model parameter of xpdb objects in an xpose_set
edit_xpose_data

Master xpdb editing function
duplicated.xpose_set

Check if any xpose_data objects are repeated in xpose_set
get_prm

Access model parameters
franken_prop

Combine a property from all components of a franken_xpdb
get_prop

Generic function to extract a property from a model summary
expose_property

Expose a property of xpdb objects in an xpose_set
get_prm_nlmixr2

get_prm equivalent for nlmixr2 fits
get_cov_matrix

Extract a parameter covariance or correlation matrix
fill_prob_subprob_method

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

Combine several xpose_data objects into one
filter.xpose_set

Filtration method for xpose_set
focus_xpdb

Focus on an xpdb object in an xpose_set
ind_roc

Individual ROC plots
grab_xpose_plot

Grab processed xpose_plot
%p%

Binary check if LHS is parent of RHS
eta_grid

Grid plots
ind_plots_sample

Individual plots for a (stratified) sample of individuals
get_shk

Get shrinkage estimates from model summary
get_xtras_option

Inspect which xpose.xtras option value is dominant
get_index

Get full index for xpose_data data
ggsave_xp

Save a plot with xpose.xtras default output resolution
iofv_vs_mod

Objective function changes across models
is_xp_xtras

Basic class checker for xp_xtras
list_vars

Updates to list_vars
irep

Add simulation counter
join_backfill

Left join, backfilling shared columns instead of duplicating them
as_leveler

Level-defining helper functions
list_dv_probs

For a categorical DV variable, show associated probabilities
left_join_x

Backfill missing variables via a left join
dv_vs_ipred_modavg

Model average plots
logLik.xpose_data

Log-likelihood, AIC and BIC for xpose_data objects
is_franken_xpdb

Is this a model-averaged/combined ("franken") xpose_data object?
nlmixr2_as_xtra

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

Create a model-averaged xpose data object
normalize_etas

Normalize etas by their omega- or empirical-SD-implied scale
param_selector

Select parameter row number
mutate_prm

Transform parameter values in place
nlmixr_example

Generate example xp_xtras objects from nlmixr2 fits
modify_xpdb

Add, remove or rename variables in an xpdb
nlmixr2_prm_associations

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

Mutate the file table for an xpose data object
mutate.xpose_set

Mutation method for xpose_set
pheno_base

An xp_xtras example of a base model
patch_condn

Patch condition number extraction
plot.xpose_data

Generate a batch of diagnostic plots from an xpdb
persist_process_presets

Write current process presets out to a .Rprofile
%>%

Pipe operator
pheno_saem

An xp_xtras example of a final model
pheno_final

An xp_xtras example of a final model
pkpd_m3

An xp_xtras example of an M3 model
pheno_set

A more complex example of xpose_set object
pkpd_m3_df

An xp_xtras example of an M3 model (dataset)
recalc_shk

Recalculate eta shrinkage from individual estimates
reportable_digits

Reportable digits for model fit
proc_levels

Convert levels list into tibble
ipred_vs_ipred

Compare model predictions
prm_contcov

Continuous/categorical covariate effect tables
pull.xpose_set

Pulling method for xpose_set
reexports

Objects exported from other packages
print.xpose_plot

Draw an xpose_plot object
rename.xpose_set

Renaming method for xpose_set
print.xpose_data

Print an xpose_data object
reshape_set

Convert xpose_set to a nested list.
roc_plot

ROC Plot for categorical DVs
set_default_plots

Set a default plot spec on an xp_xtras object
set_dv_probs

Set probability columns for categorical endpoints
set_base_model

Base model for xpose_set
set_default_watermark

Set default watermark options on an xp_xtras object
roc_by_mod

ROC curve across models
set_default_labs

Set default plot label overrides on an xp_xtras object
select.xpose_set

Selection method for xpose_set
select_subset

Convenience wrapper for tidyselect
set_var_levels

Set variable levels
set_var_types

Set variable types
set_var_types.default

Set variable types
set_prop

Set a summary property
set_var_types_x

Set variable types
set_xtras_options

Set xpose.xtras session options
set_option

Set an xpose option
set_var_types.xp_xtras

Set variable types
shark_plot

Individual contributions to dOFV
shark_colors

Change colors of shark plots
test_nlmixr2_has_fit

Test if xpose data object has a fit object
val2lvl

Translate values to levels
shk_vs_catcov

Shrinkage contribution versus categorical covariates
shk_grid

Shrinkage contribution grid plots
shk_vs_contcov

Shrinkage contribution versus continuous covariates
summarise_xpdb

Group/ungroup and summarize variables in an xpdb
test_nlmixr2_is_old_fit

Test if nlmixr2 fit is from an old rxode2 version
test_xpdb

Logical instead of exception for xpose data check
two_set_dots

Typical processing for plots of 2 sets
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
xp_from_bbr

Convenience function for ingesting a bbr model into xpose and xpose.xtras
wrap_xp_ggally

Ensure consistent style with GGally functions
xp_var

xp_var Method
xp4_xtra_theme

Updated version of the xpose4 theme
as_xpdb_x

Convert an object to an xpose_data and xp_xtras object
prm_waterfall

Specific waterfall plots
xp_xtra_theme

Extra theme defaults
xpdb_set

An example xpose_set object
vismo_pomod

An xp_xtras example of the proportional odds categorical vismodegib model
xplot_heatmap

Generic heatmap plotting function
xplot_boxplot

Default xpose boxplot function
xplot_rocplot

Default xpose ROC plot function
xpdb_x

An example xp_xtras object
xpose_set

Generate a set of xpdb objects
xplot_pairs

Wrapper around ggpairs
logLik.xpose_set

Log-likelihood, AIC and BIC across an xpose_set
xplot_forest

Default xpose forest plot function
xplot_binned

Generic binned trend plotting function
xpose.xtras-package

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

Read model outputs directly into an xp_xtras object
xset_waterfall

Waterfall plot
xset_lineage

Determine lineage within a set
apply_default_labs

Apply default label overrides to a plot
backfill_nlmixr2_props

Populate some properties from nlmixr2 fit
add_prm_association

Describe parameter associations
backfill_iofv

Add individual objective function to data
add_cov_association

Describe parameter/covariate associations
add_xpdb

Add one or more xpdb objects to an xpose_set
add_process_preset

Add, apply, list, amend or remove xpdb processing presets
attach_nlmixr2

Attach nlmixr2 fit object to xpose data object
add_relationship

Add relationship(s) to an xpose_set
add_watermark

Add a watermark to a plot