Learn R Programming

⚠️There's a newer version (0.9.3) of this package.Take me there.

cmstatr

What It Does

The cmstatr package provides functions for performing statistical analysis of composite material data. The statistical methods implemented are those described in CMH-17-1G. This package focuses on calculating basis values (lower tolerance bounds) for material strength properties, as well as performing the associated diagnostic tests. Functions are also provided for testing for equivalency between alternate samples and the “qualification” or “baseline” samples.

Additional details about the package are available in the paper by Kloppenborg (2020, https://doi.org/10.21105/joss.02265).

Installation

To install cmstatr from CRAN, simply run:

install.packages("cmstatr")

If you want the latest development version, you can install it from github using devtools. This will also install the dependencies required to build the vignettes. Optionally, change the value of the argument ref to install cmstatr from a different branch of the repository.

install.packages(c("devtools", "rmarkdown", "dplyr", "tidyr"))
devtools::install_github("ComtekAdvancedStructures/cmstatr", build_vignettes = TRUE,
                         ref = "master",
                         build_opts = c("--no-resave-data", "--no-manual"))

Usage

To compute a B-Basis value from an example data set packaged with cmstatr you can do the following:

library(dplyr)
library(cmstatr)

carbon.fabric.2 %>%
  filter(test == "FC") %>%
  filter(condition == "RTD") %>%
  basis_normal(strength, batch)
#> 
#> Call:
#> basis_normal(data = ., x = strength, batch = batch)
#> 
#> Distribution:  Normal    ( n = 18 )
#> B-Basis:   ( p = 0.9 , conf = 0.95 )
#> 76.88082

For more examples of usage of the cmstatr package, see the tutorial vignette, which can be viewed online, or can be loaded as follows, once the package is installed:

vignette("cmstatr_Tutorial")

There is also a vignette showing some examples of the types of graphs that are typically produced when analyzing composite materials. You can view this vignette online, or you can load this vignette with:

vignette("cmstatr_Graphing")

Philosophical Notes

This package expects tidy data. That is, individual observations should be in rows and variables in columns.

Where possible, this package uses general solutions. Look-up tables are avoided wherever possible.

Issues

If you’ve found a bug, please open an issue in this repository and describe the bug. Please include a reproducible example of the bug. If you’re able to fix the bug, you can do so by submitting a pull request.

If your bug is related to a particular data set, sharing that data set will help to fix the bug. If you cannot share the data set, please strip any identifying information and optionally scale the data by an unspecified factor so that the bug can be reproduced and diagnosed.

Contributing

Contributions to cmstatr are always welcomed. For small changes (fixing typos or improving the documentation), go ahead and submit a pull request. For more significant changes, such as new features, please discuss the proposed change in an issue first.

Contribution Guidelines

  • Please create a git branch for each pull request (PR)
  • Before submitting a pull request, please make sure that R CMD check passes with no errors, warnings or notes
  • New and modified code should follow the style guide enforced by the lintr package
  • Document all exported functions using roxygen2
  • Write tests using testthat. If your contribution fixes a bug, then the test(s) that you add should fail before your bug-fix patch is applied and should pass after the code is patched.
  • For changes that affect the user, add a bullet at the top of NEWS.md below the current development version

Copy Link

Version

Install

install.packages('cmstatr')

Monthly Downloads

616

Version

0.8.0

License

AGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Stefan Kloppenborg

Last Published

February 24th, 2021

Functions in cmstatr (0.8.0)

nonpara_binomial_rank

Rank for distribution-free tolerance bound
glance.adk

Glance at a adk (Anderson--Darling k-Sample) object
ad_ksample

Anderson--Darling K-Sample Test
anderson_darling

Anderson--Darling test for goodness of fit
glance.basis

Glance at a basis object
glance.anderson_darling

Glance at an anderson_darling object
normalize_group_mean

Normalize values to group means
calc_cv_star

Calculate the modified CV from the CV
basis

Calculate basis values
equiv_mean_extremum

Test for decrease in mean or minimum individual
equiv_change_mean

Equivalency based on change in mean value
augment.mnr

Augment data with information from an mnr object
stat_normal_surv_func

Normal Survival Function
glance.equiv_mean_extremum

Glance at an equiv_mean_extremum object
stat_esf

Empirical Survival Function
glance.levene

Glance at a levene object
glance.equiv_change_mean

Glance at a equiv_change_mean object
transform_mod_cv

Transforms data according to the modified CV rule
carbon.fabric

Sample data for a generic carbon fabric
levene_test

Levene's Test for Equality of Variance
glance.mnr

Glance at a mnr (maximum normed residual) object
cv

Calculate the coefficient of variation
hk_ext

Calculate values related to Extended Hanson--Koopmans tolerance bounds
maximum_normed_residual

Detect outliers using the maximum normed residual method
cmstatr-package

cmstatr: Statistical Methods for Composite Material Data
k_equiv

k-factors for determining acceptance based on sample mean and an extremum
normalize_ply_thickness

Normalizes strength values to ply thickness
reexports

Objects exported from other packages
k_factor_normal

Calculate k factor for basis values (\(kB\), \(kA\)) with normal distribution