Learn R Programming

PAutilities

This package provides utilities to support a range of tasks in physical activity research. These include the items in the list below, which is expected to grow and mature over time. Feature/pull requests are encouraged!

  • Activity intensity classification from metabolic equivalents and (if available) posture
  • Analysis of bout detection (i.e., change point detection) algorithm performance
  • Assessment of cardiovascular disease risk
  • Bland-Altman analysis and plotting
  • Bouted moderate-to-vigorous physical activity analysis (now recommend using analyze_bouts from PBpatterns)
  • Demographic and anthropometric calculations (age, BMI, BMI-for-age percentile, weight status) (now recommend using anthropometry)
  • Formatted descriptive statistics
  • Indexed run length encoding
  • Metabolic calculations (energy expenditure, unit conversions, resting energy expenditure predictions, sliding window resting metabolic rate calculations)
  • Paired equivalence testing (including a plot method)
  • Programming management (e.g. runtime updates, object comparisons)
  • Reordering data frame variables

Copy Link

Version

Install

install.packages('PAutilities')

Monthly Downloads

68

Version

1.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Paul Hibbins

Last Published

August 21st, 2022

Functions in PAutilities (1.1.0)

as

As("summaryTransition", "data.frame")
add_summaryTransition

Addition and subtraction for objects of class summaryTransition
cvd_risk

Calculate risk of cardiovascular disease
descriptives

Compute descriptive statistics for a variable in the metabolic data set
ba_plot

Create a Bland-Altman plot
PAutilities

PAutilities: Streamline Physical Activity Research
ba_analysis

Perform Bland-Altman analysis on a data frame
DAgostino_wrapper

Assess risk using the method of D'Agostino et al. (2008)
bmi_internal

Internal helper functions for get_BMI_percentile
bout_mvpa

Classify moderate-to-vigorous physical activity in bouts of a specific minimum length
get_BMI_percentile

Calculate youth BMI percentile from CDC standards
get_age

Calculate age
get_proposer_rank

Rank preferences for an arbitrary proposer and rejecter, based on distance (i.e., difference) between them
get_ree

Calculate resting energy expenditure
get_ree_dataframe

Internal functions for calculating resting energy expenditure
df_reorder

Reorder the columns of a data frame
df_continuous

Check if a dataframe is continuous
get_transition_info

Invoke the Transition Pairing Method
get_intensity

Classify activity intensity
paired_equivalence_test.data.frame

Perform equivalence testing on paired samples
get_indices

Retrieve indices for a rolling window analysis
mean_sd

Compute the mean and standard deviation of a vector, returning a formatted string containing the values as `M +/- SD`
rmr_sliding

Calculate resting metabolic rate using a sliding window method
metabolic_row_wise

Dispatch resting metabolic rate calculations based on data frame input that specifies conversions etc.
paired_equivalence_wrapper

A template function for conducting a paired equivalence test
rolling_groups

Loop along a vector, returning n elements at a time in a list
dim_check

Account for cases that refuse all matches
summaryTransition-class

An S4 class containing summary information about a transition object
plot.transition

Plot the transitions and matchings from a transition object
get_preferences

Obtain preference lists for predicted and actual (reference) activity transitions
test_errors

Compare numeric variables in a data frame based on root-squared differences
weight_status

Determine weight status from body mass index
get_kcal_vo2_conversion

Retrieve conversion factors from kilocalories to oxygen consumption
get_matchings

Obtain the matchings for predicted and actual activity transitions using the college admissions algorithm
full_days

Drop incomplete days from a dataset
ex_data

Example data for calculating bouts of moderate-to-vigorous physical activity
get_bmi

Calculate body mass index
epoch_length_sec

Determine epoch length in seconds
equivalent_at

Determine the minimum equivalence zone necessary for establishing equivalence in a paired equivalence test
spurious_curve

Perform a spurious curve analysis
manage_procedure

Printing and timing utility for managing processes
get_bmr

Retrieve estimated basal metabolic rate for an individual
sequence_check

Label matchings for rejection if the assignment violates sequential nature of the data
index_runs

Run length encoding with indices
plot.paired_equivalence

Plot the outcome of a paired equivalence test
plot.spurious_curve

Plot a spurious curve
weir_equation

Calculate energy expenditure using the Weir equation
reconstruct_transitions

Impute placeholder values into a transition object
residual_adjust

Perform residual adjustment on an epidemiologic variable
n_crossings

Determine the number of temporal conflicts among the pairs assigned by the Gale-Shapley algorithm
new_paired_equivalence

A combined constructor and validator for paired_equivalence objects