make.groups: Grouped data from multiple vectors

Description Usage Arguments Value Author(s) See Also Examples

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

1

Arguments

...

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

data

all the vectors supplied, concatenated

which

factor indicating which vector the corresponding data value came from

When all the input arguments are data frames, the result of rbind applied to them, along with an additional which column as described above.

Author(s)

Deepayan Sarkar Deepayan.Sarkar@R-project.org

See Also

Lattice

Examples

1
2
3
4
5
6
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"))


Search within the lattice package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.