## S3 method for class 'default':
tile(x,
tile_type = c("area", "squaredarea", "height", "width"),
halign = c("left", "center", "right"),
valign = c("bottom", "center", "top"),
split_vertical = NULL,
shade = FALSE,
spacing = spacing_equal(unit(1, "lines")),
set_labels = NULL,
margins = unit(3, "lines"),
keep_aspect_ratio = FALSE,
legend_width = NULL,
squared_tiles = TRUE,
main = NULL, sub = NULL, ...)
## S3 method for class 'formula':
tile(formula, data,
\dots, main = NULL, sub = NULL, subset = NULL, na.action = NULL)
data
"table"
or "ftable"
.NA
s. Ignored if data
is a contingency
table.x
(values are recycled as needed).
A TRUE
component indicates that the tile(s) of the
corresponding dimension should be split vertically, F
strucplot
for more
information).strucplot
)."unit"
of length 4, or
a numeric vector of length 4. The elements are recycled as needed.
The four components specify the top, right,
bottom, and left margin of the plot, respectively.
When a numeric "unit"
of length
1 specifying the width of the legend (if any). Default: 5 lines.FALSE
to enable the creation of
squared tiles.TRUE
, the
name of the data
object is used.strucplot
"structable"
visualized is returned invisibly."width"
,
"height"
, "area"
, or squared area is proportional to the
corresponding entry. The first three options allow
column-wise, row-wise and overall comparisons, respectively. The last
variant allows to compare the tiles both column-wise and row-wise,
considering either the width or the height, respectively. In contrast to other high-level strucplot functions, tile
also accepts a table with duplicated levels (see examples). In this
case, artificial dimnames will be created, and the actual ones are
drawn using set_labels
.
Note that multiway-tables are first structable
.
assoc
,
strucplot
,
mosaic
,
structable
,data("Titanic")
## default plot
tile(Titanic)
tile(Titanic, type = "expected")
tile(Titanic, shade = TRUE)
## some variations
tile(Titanic, tile_type = "squaredarea")
tile(Titanic, tile_type = "width", squared_tiles = FALSE)
tile(Titanic, tile_type = "height", squared_tiles = FALSE)
tile(Titanic, tile_type = "area", halign = "center", valign = "center")
## repeat levels
tile(Titanic[,,,c(1,2,1,2)])
Run the code above in your browser using DataLab