Learn R Programming

xgxr - Exploratory Graphics R Package - README

The xgxr package supports a structured approach for exploring PKPD data, which is used by xGx website. The package contains helper functions for enabling the modeler to follow best R practices (by appending the program name, figure name location, and draft status to each plot) and the package enables the modeler to follow best graphical practices (by providing an xgx theme that reduces chart ink, and by providing time-scale, log-scale, and reverse-log-transform-scale functions for more readable axes). Finally, the package provides some data checking and summarizing functions for rapidly exploring a PKPD dataset.

Detailed documentation of xgxr is available here

The xgxr package is also available on CRAN.

A cheatsheet for the xGx website and xgxr package is available here

If you're interested in contributing to this package, we follow the tidyverse style guide.

Copy Link

Version

Install

install.packages('xgxr')

Monthly Downloads

1,438

Version

1.1.2

License

MIT + file LICENSE

Maintainer

Andrew Stein

Last Published

March 22nd, 2023

Functions in xgxr (1.1.2)

StatSummaryOrdinal

Stat ggproto object for creating ggplot layers of binned confidence intervals for probabiliities of classes in ordinal data
predictdf.nls

Prediction data frame for nls
sad

Single Ascending Dose Data Set
reexports

Objects exported from other packages
xgx_check_data

Check data for various issues
xgx_breaks_time

Sets the default breaks for a time axis
predictdf.polr

Prediction data frame for polr
xgx_geom_ci

Plot data with mean and confidence intervals
mad_nca

Multiple Ascending Dose Noncompartmental Analysis (NCA) dataset
predict.nls

predict.nls
predictdf

Prediction data frame from ggplot2 Get predictions with standard errors into data frame
theme_xgx

Calls the standard theme for xGx graphics
case1_pkpd

Case 1 PKPD Data Set
xgx_geom_pi

Plot data with median and percent intervals
nlmixr_theo_sd

nlmixr Theophylline SD Data Set
xgx_annotate_filenames

Append filenames to bottom of the plot
xgx_scale_y_log10

log10 scales the y axis with a "pretty" set of breaks
xgx_annotate_status_png

Annotate a png file or directory of png files
xgx_annotate_status

Create a status (e.g. DRAFT) annotation layer
xgx_scale_x_reverselog10

Reverse-log transform for the x scale.
%>%

Pipe operator
xgx_conf_int

xgx_conf_int returns a dataframe with mean +/- confidence intervals
xgx_scale_y_percentchangelog10

percentchangelog10 transform for the y scale.
xgx_labels_log10

Nice labels for log10.
xgx_breaks_log10

Sets the default breaks for log10
xgx_summarize_covariates

Summarize Covariate information in a dataset
xgx_scale_x_time_units

Convert time units for plotting
xgx_theme

Calls the standard theme for xGx graphics
xgx_summarize_data

Check data for various issues
xgx_dirs2char

Append filenames to bottom of the plot
xgx_save_table

Saving table as an image, also labeling the program that created the table and where the table is stored
xgx_auto_explore

Produce an xgx-styled report the given dataset using xgx R markdown templates, or a user-provided R markdown template. (Note: The R markdown template provided must be formatted in a similar manner to that of the xgx R markdown templates to work.) The working directory will contain a new directory (`xgx_autoexplore_output`) after running this function, which will contain a directory for the dataset, and futher a directory for the type of analysis / R markdown template.
xgx_theme_set

Sets the standard theme for xGx graphics
xgx_plot

Create a new xgx plot
xgx_save

Saving plot, automatically annotating the status and denoting the filenames
xgx_scale_x_log10

log10 scales the x axis with a "pretty" set of breaks
xgx_stat_pi

Plot data with median and percent intervals
xgx_stat_smooth

Wrapper for stat_smooth
xgx_scale_y_reverselog10

Reverselog transform for the y scale.
xgx_minor_breaks_log10

Sets the default minor_breaks for log10 scales
xgx_stat_ci

Plot data with mean and confidence intervals
get_rmd_str

get_rmd_str returns a Rmd template string, based on the desired PKPD parameters
mad_missing_duplicates

Multiple Ascending Dose Data Set (Duplicates Removed)
edit_rmd_template_str

Edit a Rmd Template from xgx
get_rmd_name

Determine the name of a Rmd template
StatSmoothOrdinal

Stat object for producing smooths through ordinal data
mad

Multiple Ascending Dose Data Set
StatSummaryBinQuant

Stat ggproto object for binning by quantile for xgx_stat_ci