dotplotall function 5 data missing 0 kmeansoutput missing 0 parnames missing 0 whichclusters missing 0 { 7 comment.expression 2 comment 1 character 12 # # dotplotall(): Generates plots showing clusters in unique colors, #\tusing all combinations of parameters. 'data' is the imported flow #\tdata, where columns represent parameters and rows represent events. #\t'kmeansoutput' is the output of kmeans(). 'parnames' is a list of #\tthe names of the parameters in 'data'. 'whichclusters' is a list #\tof the clusters that are to be plotted. # # (c)1997 Michael Boland # # Confirm that the inputs to the function are appropriately sized. # if 2 call 3 name 1 < call 2 name 1 ncol name 1 data numeric 1 2 { 1 call 2 name 1 stop message character 1 Requires at least two parameters for plotting if 2 call 3 name 1 != call 2 name 1 ncol name 1 data call 2 name 1 length name 1 parnames { 1 call 2 name 1 stop message character 1 The number of parameters in data does not match the number of names in parnames. if 2 call 3 name 1 <= call 2 name 1 length name 1 whichclusters numeric 1 0 { 1 call 2 name 1 stop message character 1 The number of clusters to plot must be greater than 0. comment.expression 2 if 2 call 3 name 1 != call 2 name 1 length call 3 name 1 $ name 1 kmeansoutput character 1 cluster call 2 name 1 nrow name 1 data { 1 call 2 name 1 stop message character 1 The number of points in data does not match the length of the kmeansoutputs$cluster field. comment 1 character 3 # # Calculate the number of plots, then generate each one. #\t <- 2 name 1 numplots call 3 name 1 / call 2 name 1 factorial call 2 name 1 ncol name 1 data ( 2 name 1 ( call 3 name 1 * numeric 1 2 call 2 name 1 factorial call 3 name 1 - call 2 name 1 ncol name 1 data numeric 1 2 call 2 name 1 par mfrow call 3 name 1 c call 2 name 1 ceiling call 3 name 1 / name 1 numplots numeric 1 2 numeric 1 2 for 3 xpar NULL 0 call 3 name 1 : numeric 1 1 ( 2 name 1 ( call 3 name 1 - call 2 name 1 ncol name 1 data numeric 1 1 { 1 for 3 ypar NULL 0 call 3 name 1 : ( 2 name 1 ( call 3 name 1 + name 1 xpar numeric 1 1 call 2 name 1 ncol name 1 data { 2 call 6 name 1 plot call 4 name 1 [ name 1 data missing 0 name 1 xpar call 4 name 1 [ name 1 data missing 0 name 1 ypar type character 1 n xlab call 3 name 1 [ name 1 parnames name 1 xpar ylab call 3 name 1 [ name 1 parnames name 1 ypar for 3 clusternum NULL 0 name 1 whichclusters { 1 call 5 name 1 text call 4 name 1 [ name 1 data call 3 name 1 == call 3 name 1 $ name 1 kmeansoutput character 1 cluster name 1 clusternum name 1 xpar call 4 name 1 [ name 1 data call 3 name 1 == call 3 name 1 $ name 1 kmeansoutput character 1 cluster name 1 clusternum name 1 ypar character 1 . col name 1 clusternum