Learn R Programming

sm (version 2.0-2)

sm.options: Set or return options of sm library

Description

Provides a means to control the behaviour of the sm library such as the colour of the plotted lines, the size of the grid in 2-D estimation, the set of evaluations points, and many others.

Usage

sm.options(...)

Arguments

...
a list may be given as the only argument, or a vector of character strings given as the only argument, or any number of arguments may be in the name=value form , or no argument at all may be given. See the Value and Side Effects sections for
add
a logical value which controls whether the density estimate is added to the current plot. Its default value is FALSE, which creates a new plot. This argument applies only with one-dimensional data.
band
a logical value which controls whether the reference band appears on the plot. This argument applies only with one-dimensional data. Default: band=FALSE.
col
The colour used for plotting observed points and estimated curves. Default: col=1.
delta
a value which will be added to the data before they are log transformed in the procedure to handle positive data. The value of delta is used only when positive takes the value TRUE. The default value is the smalles
describe
This affectcs the behaviour of sm.script and provide.data. If describe=TRUE (default), a data documentation file is printed.
diff.ord
an integer defining the degree of differencing to be applied in the esimtation process. When this argument is set to 1, the method of Rice, based on the squared differences of pairs of neighbouring observations, is used. When the argument is set to 2 (d
display
This argument applies only with one- or two-dimensional data. The setting "none" will prevent any graphical output from being produced. In one dimension, the default setting "estimate" will produce the density estimate, while
eval.points
the points at which the density or the regression curve or surface estimate should be evaluated, for the values returned in the result of the function. This should be a vector for one-dimensional data and a two-column matrix for two-dimensional data.
eye.mult
a vector of length 3 defining the eye position for the perspective plot in the two covariate case. The interpretation of this argument is similar to the argument eye in the persp function. Here the argument is automatically sca
h.weights
a vector of weights which multiply the smoothing parameter used in the kernel function at each observation. This argument does not apply with three-dimensional data. Default: h.weights=1.
hmult
a factor which can be used to multiply the normal smoothing parameter before construction of the density estimate. Default: h.mult=1.
hull
a logical value which controls whether the estimate is evaluated and plotted only on grid points which fall within the convex hull of the data. When this argument is set to FALSE, evaluation and plotting take place at all grid points where
lty
the line type used to plot the estimate. This argument applies only with one covariate.
nbins
The number of bins used in one-dimensional binning operations; in two-dimensional cases, nbins refers to the number of bins formed along each axis. Bins with 0 observed frequencies are ignored. If nbins=0, binning is not perform
ngrid
The number of points in the regular grid used to plot the estimate. For two- and three-dimensional data, ngrid refers to the number of points along the axis in each dimension. The same parameter is also used by a few other functions which per
panel
a logical value which controls the appearance of a panel display, in the case of one- or two-dimensional data. The panel can be used to alter the value of the smoothing parameter. For one-dimensional data it can also launch an animation, and superimpose
pch
the standard plottig charater identfier for data plotting. Default: pch=1.
phi
the vertical rotation (in radians) of the contour plot of the density estimate from three-dimensional data. The default value is $\pi/4$.
poly.index
an integer defining local constant (0) or local linear (1) smoothing. (default value is 1)
positive
a logical value which indicates whether the data should be assumed to take positive values only. When this argument is set to TRUE, a log transformation is applied to the data before construction of a density estimate. The result is transfo
props
a vector defining the proportions of the data to be included within each contour in a slice plot, from two-dimensional data, or a contour surface plot, from three-dimensional data. In the three-dimensional case only the first element of the vector will b
rugplot
Logical flag which regulates whetehr a rugplot is superimposed to the density estimate, in the univariate case. Dafault: rugplot=TRUE.
test
a logical flag controlling the production of a formal test, using the reference model as the null hypothesis. Defaul: test=TRUE.
theta
the horizontal rotation (in radians) of the contour plot of the density estimate from three-dimensional data. The default value is $\pi/4$.
xlab
the label attached to the x-axis.
xlim
the range of the horizontal axis of the plot. This argument does not apply with three-dimensional data.
yht
the upper limit of the vertical axis in a plot of a one-dimensional density estimate. The lower limit is always set to 0. This argument does not apply with two- or three-dimensional data.
ylab
the label attached to the y-axis.
ylim
the range of the vertical axis of the plot. This argument does not apply with three-dimensional data.
zlab
the label attached to the z-axis (three-dimensional plots only)

Value

  • a list with the updated values of the parameters; if the argument list is not empty, the returned list is invisible.

Details

the parameter values set via a call to this function will remain in effect for the rest of the session, affecting the subsequent behaviour of the other functions of the sm library for which the given parameters are relevant.

This offers the possibility of customizing the functioning of the sm library, for instance by insertions of approriate calls to sm.options in .First. However, assignements of sm.options are done at frame 0, hence this must be done using a call as shown in the example below.

Examples

Run this code
sm.options(poly.index=0)
# subsequent regression estimations will be performed using local means
# instead of local regression
#
sm.options(describe=F)  
# turns off typing documentation files of data loaded by `sm.script'
# (works from command-line)
# 
assign(".sm.Options", sm.options(describe = FALSE), envir=.GlobalEnv)
# this line can be inserted in `.First' for permanent customisation

Run the code above in your browser using DataLab