An important subset of statistical data comes in the form of tables. Tables usually record the frequency or proportion of observations that fall into a particular category or combination of categories. They could also encode some other summary measure such as a rate (of binary events) or mean (of a continuous variable). In R, tables are usually represented by arrays of one (vectors), two (matrices), or more dimensions. To distinguish them from other vectors and arrays, they often have class “table”. The R functions table() and xtabs() can be used to create tables from raw data.
Graphs of tables do not always convey information more easily than the tables themselves, but they often do. The barchart() and dotplot() functions in lattice are designed to display tabulated data. As with other high-level functions, the primary formula interface requires the data to be available as a data frame. The as.data.frame.table() function can be used for converting tables to suitable data frames. In addition, there are methods in lattice that work directly on tables. We focus on the latter in this chapter; examples using the formula interface can be found in Chapter 2.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2008 Springer Science+Business Media, LLC
About this chapter
Cite this chapter
(2008). Displaying Multiway Tables. In: Lattice. Use R!. Springer, New York, NY. https://doi.org/10.1007/978-0-387-75969-2_4
Download citation
DOI: https://doi.org/10.1007/978-0-387-75969-2_4
Publisher Name: Springer, New York, NY
Print ISBN: 978-0-387-75968-5
Online ISBN: 978-0-387-75969-2
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)