Learn R Programming

openxlsx2 (version 1.13)

create_border: Create border format

Description

This function creates border styles for a cell in a spreadsheet. Border styles can be any of the following: "none", "thin", "medium", "dashed", "dotted", "thick", "double", "hair", "mediumDashed", "dashDot", "mediumDashDot", "dashDotDot", "mediumDashDotDot", "slantDashDot". Border colors can be created with wb_color().

Usage

create_border(
  diagonal_down = "",
  diagonal_up = "",
  outline = "",
  bottom = NULL,
  bottom_color = NULL,
  diagonal = NULL,
  diagonal_color = NULL,
  end = "",
  horizontal = "",
  left = NULL,
  left_color = NULL,
  right = NULL,
  right_color = NULL,
  start = "",
  top = NULL,
  top_color = NULL,
  vertical = "",
  start_color = NULL,
  end_color = NULL,
  horizontal_color = NULL,
  vertical_color = NULL,
  ...
)

Value

A formatted border object to be used in a spreadsheet.

Arguments

diagonal_down, diagonal_up

Logical, whether the diagonal border goes from the bottom left to the top right, or top left to bottom right.

outline

Logical, whether the border is.

bottom, left, right, top, diagonal

Character, the style of the border.

bottom_color, left_color, right_color, top_color, diagonal_color, start_color, end_color, horizontal_color, vertical_color

a wb_color(), the color of the border.

horizontal, vertical

Character, the style of the inner border (only for dxf objects).

start, end

leading and trailing edge of a border.

...

Additional arguments passed to other methods.

See Also

wb_add_border()

Other style creating functions: create_cell_style(), create_colors_xml(), create_dxfs_style(), create_fill(), create_font(), create_numfmt(), create_tablestyle()

Examples

Run this code
# Create a border with a thick bottom and thin top
border <- create_border(
  bottom = "thick",
  bottom_color = wb_color("FF0000"),
  top = "thin",
  top_color = wb_color("00FF00")
)

Run the code above in your browser using DataLab