| quadruple.counts | R Documentation | 
Count 4-tuples of adjacent symbols/elements in a character vector.
quadruple.counts(x, case=c("lower", "upper", "as is"), circular=TRUE)
x | 
 a character vector or an object that can be coersed to a character vector.  | 
case | 
 determines how labels for the array should be generated: in 'lower' case, in ' upper' case or 'as is', in which case labels such as 'b' and 'B' will be counted as distinct elements and counted separately.  | 
circular | 
 Determines if the vector should be treated as circular or not.  The default is 
  | 
If circular is TRUE, the vector is treated as circular so that the 
some of all the counts in the resulting array is equal to the length of the 
vector and the sums across all dimentions of the array are equivalent, that is: 
if we write
q <- quadruple.counts(x) 
for some character sequence x, then 
apply(q,1,sum), apply(q,2,sum), apply(q,3,sum) and apply(q,4,sum) 
are all identical.
On the other hand, if circular is FALSE, the sum of all the 
entries in the counts array will be two less than the length of the vector and 
there will be a discrepancy between the sums over the various dimensions.
A 4-dimensional array of counts.  The labels of the i-th dimension correspond to
the i-th item in each tuple, where i is either 1, 2, 3 or 4.
Andrew Hart and Servet MartÃnez
pair.counts, triple.counts,
cylinder.counts, 
array2vector, table2vector
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.