supsc: Converts a string to UTF-8 superscript

View source: R/supsc.R

supscR Documentation

Converts a string to UTF-8 superscript

Description

The supsc function translates a normal character to a UTF-8 superscript character. The function can be used to generate superscripts for many common characters. Most alphabetic and numeric characters have UTF-8 superscripts. This function is useful because it saves you from having to look up the superscript character code, or copy and pasting from the internet. If a corresponding superscript character code does not exist, a question mark will be returned for that character.

Usage

supsc(x)

Arguments

x

A string to be converted to superscript.

Value

The superscript version of the string passed to the function, if one exists. Otherwise, a question mark will be returned.

See Also

Other utf8: subsc(), symbol()

Examples

# Single letter
paste0(supsc("a"), "Footnote")

# Single number
paste0(supsc("1"), "Footnote")

# Character string
paste0("December 5", supsc("th"))

# Formula
paste0("x", supsc("(a+1)"))

common documentation built on Sept. 18, 2022, 5:05 p.m.