Learn R Programming

qcc (version 2.6)

qcc.groups: Grouping data based on a sample indicator

Description

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

Usage

qcc.groups(data, sample)

Arguments

data
the observed data values
sample
the sample indicators for the data values

Value

The function returns a matrix of suitable dimensions. If one or more group have few observations than others, NA values are appended.

See Also

qcc

Examples

Run this code
data(pistonrings)
attach(pistonrings)
# 40 sample of 5 obs each
qcc.groups(diameter, sample)
# some obs are removed, the result is still a 40x5 matrix but with NAs added
qcc.groups(diameter[-c(1,2,50,52, 199)], sample[-c(1,2,50,52, 199)])

Run the code above in your browser using DataLab