addSuperScriptToCell: Add superscipts/subscripts to Excel files

View source: R/superscript.R

addSuperScriptToCellR Documentation

Add superscipts/subscripts to Excel files

Description

Writes text to a cell within a wookbook object and adds a superscript or a subscript.

Usage

addSuperScriptToCell(
  wb,
  sheet,
  row,
  col,
  text,
  superScriptText,
  position = nchar(text),
  superOrSub = TRUE,
  size = "10",
  colour = "000000",
  font = "Arial",
  family = "2",
  bold = FALSE,
  italic = FALSE,
  underlined = FALSE
)

Arguments

wb

A workbook object

sheet

A sheet within the workbook object

row

The row number you want to write to

col

The column number you want to write to

text

The text (not including the superscript) you want written.

superScriptText

The text you want in the superscript

position

A number specifying how far along in the text you want the superscript to occur. Defaults to nchar(text), (ie, the last position)

superOrSub

TRUE or FALSE is you want to return a superscript or a subscript. Defaults to superscript (TRUE)

size

The size of the font. Defaults to 10

colour

The hex code of the colour of the text. Defaults to black (000000)

font

The font. Defaults to Arial

family

Not sure what this is for. Leave it alone at 2 if you don't know either

bold

TRUE or FALSE if you want text to be bold

italic

TRUE or FALSE if you want text to be italic

underlined

TRUE or FALSE if you want text to be underlined

Examples

## Not run: 
addSuperScriptToCell(wb = wb,
 sheet = "2.1",
 row = 1,
 col =1,
 text = "Table 2.1: First prison receptions by type of first reception, sentence length and sex",
 superScriptText = "(1)",
 position = 34,
 superOrSub = TRUE,
 size = '12',
 colour = '000000',
 font = 'Arial',
 family = '2',
 bold = TRUE,
 italic = FALSE,
 underlined = FALSE)

## End(Not run)


moj-analytical-services/mojrap documentation built on July 30, 2023, 4:43 p.m.