qccGroups: Grouping data based on a sample indicator

View source: R/utilities.R

qccGroupsR Documentation

Grouping data based on a sample indicator

Description

This function allows to easily group data to use as input to the qcc() function.

Usage

qccGroups(data, x, sample)

Arguments

data

a data frame (or a similar structure which can be coerced to be a data.frame) providing the observed data. If not provided, the input to the following arguments must be objects defined in the calling environment.

x

a name from data or a vector of observed data values.

sample

a name from data or a vector of sample indicators defining the rationale subgroups of data values.

Value

The function returns a matrix of suitable dimensions. If one or more group have fewer observations than others, NA values are used to fill empty values.

Author(s)

Luca Scrucca

See Also

qcc

Examples

data(pistonrings)
# create a matrix of 40 samples made of 5 observations each
qccGroups(data = pistonrings, diameter, sample)
# remove some observations to get still a 40x5 matrix but filled with NAs 
qccGroups(data = pistonrings[-c(1,2,50,52,199),], diameter, sample)

luca-scr/qcc documentation built on Feb. 25, 2023, 3:33 p.m.