File: make.groups.Rd

package info (click to toggle)
lattice 0.20-41-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,988 kB
  • sloc: ansic: 357; makefile: 2
file content (46 lines) | stat: -rw-r--r-- 1,393 bytes parent folder | download | duplicates (6)
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
\name{D_make.groups}
\alias{make.groups}
\title{ Grouped data from multiple vectors }
\description{
  Combines two or more vectors, possibly of different lengths, producing
  a data frame with a second column indicating which of these vectors
  that row came from.  This is mostly useful for getting data into a
  form suitable for use in high level Lattice functions.
}
\usage{
make.groups(\dots)
}
\arguments{
  \item{\dots}{
    one or more vectors of the same type (coercion is attempted if not),
    or one or more data frames with similar columns, with possibly
    differing number of rows.
  }
}
\value{
  When all the input arguments are vectors, a data frame with two
  columns
  \item{\code{data}}{
    all the vectors supplied, concatenated
  }
  \item{\code{which}}{
    factor indicating which vector the corresponding \code{data} value
    came from
  }
  When all the input arguments are data frames, the result of
  \code{\link{rbind}} applied to them, along with an additional
  \code{which} column as described above.
}

\author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}}
\seealso{\code{\link{Lattice}}}
\examples{
sim.dat <-
    make.groups(uniform = runif(200),
                exponential = rexp(175),
                lognormal = rlnorm(150),
                normal = rnorm(125))
qqmath( ~ data | which, sim.dat, scales = list(y = "free"))
}
\keyword{dplot}