Learn R Programming

clifford (version 1.0-2)

Extract.clifford: Extract or Replace Parts of a clifford

Description

Extract or replace subsets of cliffords.

Usage

# S3 method for clifford
[(C, index, …)
# S3 method for clifford
[(C, index, …) <- value
coeffs(x)
coeffs(x) <- value

Arguments

C,x

A clifford object

index

elements to extract or replace

value

replacement value

...

Further arguments

Details

Extraction and replacement methods. The extraction method uses getcoeffs() and the replacement method uses low-level helper function c_overwrite().

In the extraction function a[index], if index is a list, further arguments are ignored. If not, the dots are used.

Replacement methods using list-valued index, as in A[i] <- value uses an ugly hack if value is zero.

Idiom such as a[] <- b follows the spray package. If b is a length-one scalar, then coeffs(a) <- b has the same effect as a[] <- b.

Functions terms() [see term.Rd]and coeffs() are the extraction methods. These are unordered vectors but the ordering is consistent between them (an extended discussion of this phenomenon is presented in the mvp package).

Function coeffs<-() (idiom coeffs(a) <- b) sets all coefficients of a to b. This has the same effect as a[] <- b.

See Also

Ops.clifford,clifford,term

Examples

Run this code
# NOT RUN {
A <- clifford(list(1,1:2,1:3),1:3)
B <- clifford(list(1:2,1:6),c(44,45))

A[1,c(1,3,4)]

A[2:3, 4] <- 99
A[] <- B

# }

Run the code above in your browser using DataLab