Learn R Programming

Introduction

The aim of this package is to ease or amplify the process of creating datasets mainly for pharmacometric analyses. The package contains functions to create NONMEM specific variables, perform various time calculations and help in creating dosing records. Finally, multiple functions are present for documentation and QC purposes.

The latest version can be installed using:

devtools::install_github("LeidenAdvancedPKPD/amp.dm")

The article section should get you started. Within this section there is also a PDF that represents a study example, and include code for the main functionality of the package. This example can also be used as a starting point or template for new studies.

This package was initially developed as an in-house package at LAP&P, and was started in 2015. Various versions were developed, where many people within LAP&P helped in making the package better and more robust. Without them this package wouldn't be possible!

Other packages

There are many packages for general data management like the entire tidyverse collection and more specific for pharma the pharmaverse collection.

This package is more specific for pharmacometric datasets which require some specific functionality. Related to these type of datasets there is the NMdata package. The main difference with this package is that NMdata combines data management tasks with processing of NONMEM results. This package is more focused towards dataset creation, including handling meta data and documentation.

The yspec and yamlet packages are mainly build for handling meta data, while this package handles meta data differently and combines this in the 'documented' workflow.

Copy Link

Version

Install

install.packages('amp.dm')

Version

0.2.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Richard Hooijmaijers

Last Published

March 13th, 2026

Functions in amp.dm (0.2.0)

num_lump

Perform lumping of numerical values
output_data

export R data for NONMEM modeling
egfr

Calculates EGFR values based on different types of formulas
make_readonly

Sets the read-only attribute for all files available within a folder
impute_dose

Imputes dose records using ADDL and II by looking forward and backwards
left_joinr

Perform a left join of two data frames with logging of results
weight_height

Calculates different weight variables
log_df

Create information for all functions that log actions
get_script

Get the current script name (either interactive Rstudio, markdown or batch script)
impute_covar

Imputute missing covariates
session_tbl

Create information for R session
srce

Add source information to environment to present in documentation
stats_df

Calculate basic statistics on data frame
plot_vars

Creates different kind of plots for variables within a dataset using ggplot2
time_calc

Create time variables for usage in NONMEM analyses
read_data

read external data with logging of results
check_cat

Create an overview of the available categories
attr_extract

Reads in attributes from an external excel file
attr_xls

Reads in attributes from an external excel file
cmnt_print

Function that prints the comments given by cmnt
check_nmdata

Checks nonmem dataset for common errors/mistakes
contents_df

Create information for multiple data frames
amp.dm-package

amp.dm: Data Management Tools for Pharmacometrics
cmnt

Add comment to environment to present in documentation
attr_factor

Create factors for variables within a data frame using the format attribute
attr_add

Add attributes from a list to a dataframe
get_log

Retrieve log objects
define_tbl

Create define PDF file for submission of pharmacometric data files
filterr

Filter data with logging of results
expand_addl_ii

Expand rows in case ADDL and II variables are present
flag_outliers

Creates a flag for outlying values
create_addl

Create ADDL data item and deletes unnecessary amount lines
fill_dates

Fills down dates within a data frame that include a start and end date
general_tbl

General table wrapper for documentation functions
counts_df

Create counts and frequencies within in data frame