juxtapose: Function to juxtapose two strength t CAs

View source: R/juxtapose.R

juxtaposeR Documentation

Function to juxtapose two strength t CAs

Description

Two CAs D1 and D2 with the same strength t, the same number of columns k, and the same numbers of levels in all but at most one column are juxtaposed, such that the levels of one corresponding column in each array are concatenated, resulting in a new strength t CA with the sum of the numbers of levels for that column.

Usage

juxtapose(D1, D2, jcol=NULL, start0=TRUE, ...)

Arguments

D1

a CA with levels as integers 0, ..., v-1 or 1,...,v (may have different number of levels for each column, but same coding)

D2

a CA like D1, same number of columns, same numbers of levels, except perhaps for the jcolth column; must have the same coding as D1

jcol

the id of the column to be concatenated; if NULL, it is either the only column id for which the numbers of levels differ, or 1.

start0

logical: Do integer valued levels start with 0 ? (Otherwise, they must start with 1.)

...

further arguments to function coverage

Details

Juxtaposing two CAs of a particular strength yields a new CA of the same strength. If D1 and D2 do not have the same strength, the weaker strength prevails.

Value

If D1 is a N1 x k CA of strength t and D2 is a N2 x k CA of strength t, the function returns an (N1 + N2) x k matrix of class ca, which is a CA of strength t and has the same numbers of levels as the ingoing arrays, except for the juxtaposed column jcol, for which the number of levels is the sum of the numbers of levels of the ingoing CA.

Examples

# create a CA(24,3,2^10 4^1) from two CA(12,3,11,2)

## do it by hand
A <- paleyHad(11)
A2 <- A
A2[,11] <- A[,11] + 2
coverage(rbind(A,A2),3)

## use the function
juxtapose(A, A, jcol=11)

## create a CA(13, 2^10 3^1, 2) by juxtaposing two
##    strength 2 CAs (one with a column that has only 1 level):
juxtapose(KSK(11), cbind(KSK(10), 0))
   ## note: it is not necessary to specify jcol
   ##       because there is only one column with
   ##       different number of levels


CAs documentation built on Nov. 29, 2026, 1:06 a.m.