Create a spanning header attribute object that can be attached to a data frame and passed to the create_table function. This attribute is used internally by other packages in the r-sassy system.

span(
  from,
  to,
  label = NULL,
  label_align = "center",
  level = 1,
  underline = TRUE
)

Arguments

from

The starting column to span. Spanning columns are defined as range of columns 'from' and 'to'. The columns may be identified by position, or by quoted or unquoted variable names. The from parameter is required.

to

The ending column to span. Spanning columns are defined as range of columns 'from' and 'to'. The columns may be identified by position, or by quoted or unquoted variable names. The to parameter is required.

label

The label to apply to the spanning header.

label_align

The alignment to use for the label. Valid values are "left", "right", "center", and "centre". The default for spanning columns is "center".

level

The level to use for the spanning header. The lowest spanning level is level 1, the next level above is level 2, and so on. By default, the level is set to 1.

underline

A TRUE or FALSE value indicating whether the spanning header should be underlined. Default is TRUE.

Value

The spanning header attribute object.

Details

A spanning header is a label and underline that spans one or more columns. A spanning header is defined minimally by identifying the column range to be spanned, and a label. A label alignment may also be supplied.

The spanning column range is defined by the from and to parameters. The range identifies a contiguous set of variables on the data. Variables can be identified by position, a quoted variable name, or an unquoted variable name.

See also

Other attributes: ftn(), ttl()