deftype {andrews} | R Documentation |
deftype
Description
Defines a function which can be used as basis for Andrews curves f_t(t) = \sum_{j=1}^p x_{ij} f_i(t)
.
Usage
deftype(index = NULL, FUN = NULL, xlim = c(-pi, pi))
Arguments
index |
index/name of the function |
FUN |
function of the form |
xlim |
default range for displaying curves (default: |
Value
either a list of all functions or a single function
Examples
# define a new andrews curve, just with sine curves
deftype("sine", function(n, t) {
n <- as.integer(if (n<1) 1 else n)
m <- matrix(NA, nrow=length(t), ncol=n)
for (i in 1:n) m[,i] <- sin(i*t)
m
})
andrews(iris, "sine")
# query
deftype()
deftype("sine")
[Package andrews version 1.1.2 Index]