File: spatialSign.Rd

package info (click to toggle)
r-cran-caret 7.0-1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,036 kB
  • sloc: ansic: 210; sh: 10; makefile: 2
file content (61 lines) | stat: -rw-r--r-- 1,539 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spatialSign.R
\name{spatialSign}
\alias{spatialSign}
\alias{spatialSign.default}
\alias{spatialSign.matrix}
\alias{spatialSign.data.frame}
\title{Compute the multivariate spatial sign}
\usage{
spatialSign(x, ...)

\method{spatialSign}{default}(x, na.rm = TRUE, ...)

\method{spatialSign}{matrix}(x, na.rm = TRUE, ...)

\method{spatialSign}{data.frame}(x, na.rm = TRUE, ...)
}
\arguments{
\item{x}{an object full of numeric data (which should probably
be scaled). Factors are not allowed. This could be a vector,
matrix or data frame.}

\item{...}{Not currently used.}

\item{na.rm}{A logical; should missing data be removed when
computing the norm of the vector?}
}
\value{
A vector, matrix or data frame with the same dim names
 of the original data.
}
\description{
Compute the spatial sign (a projection of a data vector to a
 unit length circle). The spatial sign of a vector \code{w} is
 \code{w /norm(w)}.
}
\examples{

spatialSign(rnorm(5))

spatialSign(matrix(rnorm(12), ncol = 3))

# should fail since the fifth column is a factor
try(spatialSign(iris), silent = TRUE)

spatialSign(iris[,-5])

trellis.par.set(caretTheme())
featurePlot(iris[,-5], iris[,5], "pairs")
featurePlot(spatialSign(scale(iris[,-5])), iris[,5], "pairs")

}
\references{
Serneels et al. Spatial sign preprocessing: a
 simple way to impart moderate robustness to multivariate
 estimators. J. Chem. Inf. Model (2006) vol. 46 (3) pp. 1402-1409
}
\author{
Max Kuhn
}
\keyword{manip}