The R Project SVN R

Rev

Rev 27541 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27541 Rev 27712
1
\name{abs}
1
\name{abs}
2
\title{Miscellaneous Mathematical Functions}
2
\title{Miscellaneous Mathematical Functions}
3
\usage{
3
\usage{
4
abs(x)
4
abs(x)
5
sqrt(x)
5
sqrt(x)
6
}
6
}
7
\alias{abs}
7
\alias{abs}
8
\alias{sqrt}
8
\alias{sqrt}
9
\description{
9
\description{
10
These functions compute miscellaneous mathematical functions.
10
These functions compute miscellaneous mathematical functions.
11
The naming follows the standard for computer languages
11
The naming follows the standard for computer languages
12
such as C or Fortran.
12
such as C or Fortran.
13
}
13
}
14
\arguments{
14
\arguments{
15
  \item{x}{a numeric vector}
15
  \item{x}{a numeric vector}
16
}
16
}
17
\details{
17
\details{
18
  These are generic functions: methods can be defined for them
18
  These are generic functions: methods can be defined for them
19
  individually or via the \code{\link{Math}} group generic.
19
  individually or via the \code{\link{Math}} group generic.
20
}
20
}
21
\seealso{
21
\seealso{
22
\code{\link{Arithmetic}} for simple, \code{\link{log}} for logarithmic,
22
\code{\link{Arithmetic}} for simple, \code{\link{log}} for logarithmic,
23
\code{\link{sin}} for trigonometric, and \code{\link{Special}} for
23
\code{\link{sin}} for trigonometric, and \code{\link{Special}} for
24
special mathematical functions.
24
special mathematical functions.
25
}
25
}
26
\references{
26
\references{
27
  Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
27
  Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
28
  \emph{The New S Language}.
28
  \emph{The New S Language}.
29
  Wadsworth \& Brooks/Cole.
29
  Wadsworth \& Brooks/Cole.
30
}
30
}
31
\examples{
31
\examples{
-
 
32
require(stats) # for spline
32
xx <- -9:9
33
xx <- -9:9
33
plot(xx, sqrt(abs(xx)),  col = "red")
34
plot(xx, sqrt(abs(xx)),  col = "red")
34
lines(stats::spline(xx, sqrt(abs(xx)), n=101), col = "pink")
35
lines(spline(xx, sqrt(abs(xx)), n=101), col = "pink")
35
}
36
}
36
\keyword{math}
37
\keyword{math}