The R Project SVN R

Rev

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

Rev 59039 Rev 61433
Line 35... Line 35...
35
  \item{x}{an object, the default method expects either a single variable
35
  \item{x}{an object, the default method expects either a single variable
36
    (interpreted to be the explanatory variable) or a 2-way table.  See
36
    (interpreted to be the explanatory variable) or a 2-way table.  See
37
    details.}
37
    details.}
38
  \item{y}{a \code{"factor"} interpreted to be the dependent variable}
38
  \item{y}{a \code{"factor"} interpreted to be the dependent variable}
39
  \item{formula}{a \code{"formula"} of type \code{y ~ x} with a single
39
  \item{formula}{a \code{"formula"} of type \code{y ~ x} with a single
40
    dependent \code{"factor"} and a single explanatory variable.}    
40
    dependent \code{"factor"} and a single explanatory variable.}
41
  \item{data}{an optional data frame.}
41
  \item{data}{an optional data frame.}
42
  \item{breaks}{if the explanatory variable is numeric, this controls how
42
  \item{breaks}{if the explanatory variable is numeric, this controls how
43
    it is discretized. \code{breaks} is passed to \code{\link{hist}} and can
43
    it is discretized. \code{breaks} is passed to \code{\link{hist}} and can
44
    be a list of arguments.}
44
    be a list of arguments.}
45
  \item{tol.ylab}{convenience tolerance parameter for y-axis annotation.
45
  \item{tol.ylab}{convenience tolerance parameter for y-axis annotation.
Line 48... Line 48...
48
  \item{off}{vertical offset between the bars (in per cent). It is fixed to
48
  \item{off}{vertical offset between the bars (in per cent). It is fixed to
49
    \code{0} for spinograms and defaults to \code{2} for spine plots.}
49
    \code{0} for spinograms and defaults to \code{2} for spine plots.}
50
  \item{ylevels}{a character or numeric vector specifying in which order
50
  \item{ylevels}{a character or numeric vector specifying in which order
51
    the levels of the dependent variable should be plotted.}
51
    the levels of the dependent variable should be plotted.}
52
  \item{col}{a vector of fill colors of the same length as \code{levels(y)}.
52
  \item{col}{a vector of fill colors of the same length as \code{levels(y)}.
53
    The default is to call \code{\link{gray.colors}}.}  
53
    The default is to call \code{\link{gray.colors}}.}
54
  \item{main, xlab, ylab}{character strings for annotation}
54
  \item{main, xlab, ylab}{character strings for annotation}
55
  \item{xaxlabels, yaxlabels}{character vectors for annotation of x and y axis.
55
  \item{xaxlabels, yaxlabels}{character vectors for annotation of x and y axis.
56
    Default to \code{levels(y)} and \code{levels(x)}, respectively for the
56
    Default to \code{levels(y)} and \code{levels(x)}, respectively for the
57
    spine plot. For \code{xaxlabels} in the spinogram, the breaks are
57
    spine plot. For \code{xaxlabels} in the spinogram, the breaks are
58
    used.}
58
    used.}
59
  \item{xlim, ylim}{the range of x and y values with sensible defaults.}  
59
  \item{xlim, ylim}{the range of x and y values with sensible defaults.}
60
  \item{axes}{logical.  If \code{FALSE} all axes (including those giving
60
  \item{axes}{logical.  If \code{FALSE} all axes (including those giving
61
    level names) are suppressed.}
61
    level names) are suppressed.}
62
  \item{\dots}{additional arguments passed to \code{\link{rect}}.}
62
  \item{\dots}{additional arguments passed to \code{\link{rect}}.}
63
  \item{subset}{an optional vector specifying a subset of observations
63
  \item{subset}{an optional vector specifying a subset of observations
64
    to be used for plotting.  }
64
    to be used for plotting.  }
Line 70... Line 70...
70
  categorical) and \code{x} the explanatory variable.  \code{x} can be
70
  categorical) and \code{x} the explanatory variable.  \code{x} can be
71
  either categorical (then a spine plot is created) or numerical (then a
71
  either categorical (then a spine plot is created) or numerical (then a
72
  spinogram is plotted).  Additionally, \code{spineplot} can also be
72
  spinogram is plotted).  Additionally, \code{spineplot} can also be
73
  called with only a single argument which then has to be a 2-way table,
73
  called with only a single argument which then has to be a 2-way table,
74
  interpreted to correspond to \code{table(x, y)}.
74
  interpreted to correspond to \code{table(x, y)}.
75
  
75
 
76
  Both, spine plots and spinograms, are essentially mosaic plots with
76
  Both, spine plots and spinograms, are essentially mosaic plots with
77
  special formatting of spacing and shading.  Conceptually, they plot
77
  special formatting of spacing and shading.  Conceptually, they plot
78
  \eqn{P(y | x)} against \eqn{P(x)}.  For the spine plot (where both
78
  \eqn{P(y | x)} against \eqn{P(x)}.  For the spine plot (where both
79
  \eqn{x} and \eqn{y} are categorical), both quantities are approximated
79
  \eqn{x} and \eqn{y} are categorical), both quantities are approximated
80
  by the corresponding empirical relative frequencies.  For the
80
  by the corresponding empirical relative frequencies.  For the
81
  spinogram (where \eqn{x} is numerical), \eqn{x} is first discretized
81
  spinogram (where \eqn{x} is numerical), \eqn{x} is first discretized
82
  (by calling \code{\link{hist}} with \code{breaks} argument) and then
82
  (by calling \code{\link{hist}} with \code{breaks} argument) and then
83
  empirical relative frequencies are taken.
83
  empirical relative frequencies are taken.
84
  
84
 
85
  Thus, spine plots can also be seen as a generalization of stacked bar
85
  Thus, spine plots can also be seen as a generalization of stacked bar
86
  plots where not the heights but the widths of the bars corresponds to
86
  plots where not the heights but the widths of the bars corresponds to
87
  the relative frequencies of \code{x}. The heights of the bars then
87
  the relative frequencies of \code{x}. The heights of the bars then
88
  correspond to the conditional relative frequencies of \code{y} in
88
  correspond to the conditional relative frequencies of \code{y} in
89
  every \code{x} group. Analogously, spinograms extend stacked
89
  every \code{x} group. Analogously, spinograms extend stacked