qcc.groups: Grouping data based on a sample indicator

Description Usage Arguments Value Author(s) See Also Examples

View source: R/qcc.R

Description

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

Usage

1

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.

Author(s)

Luca Scrucca

See Also

qcc

Examples

1
2
3
4
5
6
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)])

Example output

Package 'qcc' version 2.7
Type 'citation("qcc")' for citing this R package in publications.
     [,1]   [,2]   [,3]   [,4]   [,5]
1  74.030 74.002 74.019 73.992 74.008
2  73.995 73.992 74.001 74.011 74.004
3  73.988 74.024 74.021 74.005 74.002
4  74.002 73.996 73.993 74.015 74.009
5  73.992 74.007 74.015 73.989 74.014
6  74.009 73.994 73.997 73.985 73.993
7  73.995 74.006 73.994 74.000 74.005
8  73.985 74.003 73.993 74.015 73.988
9  74.008 73.995 74.009 74.005 74.004
10 73.998 74.000 73.990 74.007 73.995
11 73.994 73.998 73.994 73.995 73.990
12 74.004 74.000 74.007 74.000 73.996
13 73.983 74.002 73.998 73.997 74.012
14 74.006 73.967 73.994 74.000 73.984
15 74.012 74.014 73.998 73.999 74.007
16 74.000 73.984 74.005 73.998 73.996
17 73.994 74.012 73.986 74.005 74.007
18 74.006 74.010 74.018 74.003 74.000
19 73.984 74.002 74.003 74.005 73.997
20 74.000 74.010 74.013 74.020 74.003
21 73.988 74.001 74.009 74.005 73.996
22 74.004 73.999 73.990 74.006 74.009
23 74.010 73.989 73.990 74.009 74.014
24 74.015 74.008 73.993 74.000 74.010
25 73.982 73.984 73.995 74.017 74.013
26 74.012 74.015 74.030 73.986 74.000
27 73.995 74.010 73.990 74.015 74.001
28 73.987 73.999 73.985 74.000 73.990
29 74.008 74.010 74.003 73.991 74.006
30 74.003 74.000 74.001 73.986 73.997
31 73.994 74.003 74.015 74.020 74.004
32 74.008 74.002 74.018 73.995 74.005
33 74.001 74.004 73.990 73.996 73.998
34 74.015 74.000 74.016 74.025 74.000
35 74.030 74.005 74.000 74.016 74.012
36 74.001 73.990 73.995 74.010 74.024
37 74.015 74.020 74.024 74.005 74.019
38 74.035 74.010 74.012 74.015 74.026
39 74.017 74.013 74.036 74.025 74.026
40 74.010 74.005 74.029 74.000 74.020
     [,1]   [,2]   [,3]   [,4]   [,5]
1  74.019 73.992 74.008     NA     NA
2  73.995 73.992 74.001 74.011 74.004
3  73.988 74.024 74.021 74.005 74.002
4  74.002 73.996 73.993 74.015 74.009
5  73.992 74.007 74.015 73.989 74.014
6  74.009 73.994 73.997 73.985 73.993
7  73.995 74.006 73.994 74.000 74.005
8  73.985 74.003 73.993 74.015 73.988
9  74.008 73.995 74.009 74.005 74.004
10 73.998 74.000 73.990 74.007     NA
11 73.994 73.994 73.995 73.990     NA
12 74.004 74.000 74.007 74.000 73.996
13 73.983 74.002 73.998 73.997 74.012
14 74.006 73.967 73.994 74.000 73.984
15 74.012 74.014 73.998 73.999 74.007
16 74.000 73.984 74.005 73.998 73.996
17 73.994 74.012 73.986 74.005 74.007
18 74.006 74.010 74.018 74.003 74.000
19 73.984 74.002 74.003 74.005 73.997
20 74.000 74.010 74.013 74.020 74.003
21 73.988 74.001 74.009 74.005 73.996
22 74.004 73.999 73.990 74.006 74.009
23 74.010 73.989 73.990 74.009 74.014
24 74.015 74.008 73.993 74.000 74.010
25 73.982 73.984 73.995 74.017 74.013
26 74.012 74.015 74.030 73.986 74.000
27 73.995 74.010 73.990 74.015 74.001
28 73.987 73.999 73.985 74.000 73.990
29 74.008 74.010 74.003 73.991 74.006
30 74.003 74.000 74.001 73.986 73.997
31 73.994 74.003 74.015 74.020 74.004
32 74.008 74.002 74.018 73.995 74.005
33 74.001 74.004 73.990 73.996 73.998
34 74.015 74.000 74.016 74.025 74.000
35 74.030 74.005 74.000 74.016 74.012
36 74.001 73.990 73.995 74.010 74.024
37 74.015 74.020 74.024 74.005 74.019
38 74.035 74.010 74.012 74.015 74.026
39 74.017 74.013 74.036 74.025 74.026
40 74.010 74.005 74.029 74.020     NA

qcc documentation built on July 11, 2017, 9:05 a.m.