Subscript a Packet Table Object

DESCRIPTION:
Allows the user to extract or replace parts of a packet table object by using crystal names or subscripts.

USAGE:
x[i, ..., level, block]
x[i, ..., level, block] <- value
x[[i, ..., level, block]]
x[[i, ..., level, block]] <- value
x$i
x$i <- value

REQUIRED ARGUMENTS:
x:
an object of class "ptable".
i:
a vector of crystal names, positive integers, or logical vector. If i is a logical vector, it should have length equal to the number of crystals or to the number of coefficients in x. For [[, i must be an integer or a crystal name. For $, i must be a crystal name.

OPTIONAL ARGUMENTS:
level:
an integer, a logical vector or an integer vector of form 0:j. If present, i will be ignored.
block:
an integer vector with values between 0 and 2^level.
value:
replacement value for the relevant piece of the object.

VALUE:
If level is missing and i is a logical vector with the same length as the number of coefficients in x, then x[i] returns either a wp.molecule or cp.molecule object inheriting from the class "molecule". Otherwise, if level is missing, then x[i] returns an object containing all crystals corresponding to i. It returns an object of class "wpt" or "cpt" if the subscripted crystals are orthogonal. Otherwise it returns an object of class "wp" or "cp".

If level=j is not missing and block=b is not missing, then x[level=j, block=b] returns an object containing all the (j, b) crystal(s). For wavelet packet tables, the object has class "wpt". For cosine packet tables, the object has class "cpt".

Otherwise, if level=j is not missing and length(j)=1, then x[level=j] returns all the crystals in j-th level. For wavelet packet tables, the object has class "wpt". For cosine packet tables, the object has class "block.cpt".

If level=j is not missing and length(j)>1, then x[level=0:j] returns an object of ptable (a subtable of x).

All objects with class "wpt" inherit from classes "wp" and "crystal.list" or "crystal.vector". All objects with class "cpt" inherit from classes "cp" and "crystal.vector". A "block.cpt" object inherits from "cpt".

[[ subscript operator produces an object of class "cp.crystal" or "wp.crystal": x[[level=j, block=b]] returns the (j, b) crystal; x[[i]] and x$i return the i-th crystal.


DETAILS:
See the chapter "More on Wavelet Analysis" of the S+WAVELETS User's Manual for details and examples of subscripting and assignment.

SEE ALSO:
cp.table, wp.table

EXAMPLES:
xx <- make.signal("heavisine")
w0 <- wp.table(xx, n.levels=5)

w1 <- w0[level=0:3] # subtable of w0 w2 <- w0[level=3, block=5:8] # get w3.5, w3.6, w3.7, w3.0 w3 <- w0[c("s1", "D3", "w2.0", "HLL", "LLL")] # get w1.0 w3.1 w2.0 w3.0 w4 <- w0[[2]] # get wp.crystal w1.0 w5 <- w0[[level=2, block=3]] # get wp.crystal w2.3 w0[abs(w0) < 1] <- 0 # set small coefficients to 0