The R Project SVN R

Rev

Rev 27117 | Rev 38017 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27117 Rev 27716
Line 30... Line 30...
30
\seealso{
30
\seealso{
31
  \code{\link{apply}} on which \code{sweep} used to be based;
31
  \code{\link{apply}} on which \code{sweep} used to be based;
32
  \code{\link{scale}} for centering and scaling.
32
  \code{\link{scale}} for centering and scaling.
33
}
33
}
34
\examples{
34
\examples{
-
 
35
require(stats) # for median
35
data(attitude)
36
data(attitude)
36
med.att <- apply(attitude, 2, median)
37
med.att <- apply(attitude, 2, median)
37
sweep(data.matrix(attitude), 2, med.att)# subtract the column medians
38
sweep(data.matrix(attitude), 2, med.att)# subtract the column medians
38
}
39
}
39
\keyword{array}
40
\keyword{array}