greeks: Function that returns strings with Greek letters

View source: R/greekletters.R

greeksR Documentation

Function that returns strings with Greek letters

Description

Function to obtain strings with Greek letters and mathematical symbols with or without subscripts and superscripts.

Usage

greeks(greekletter)

Arguments

greekletter

is a string that contains the Greek letter name.

Details

It is recommended that the font size of the R console be increased for better visualization of the symbols, as some of the symbols are quite small.

The subscripts and supersripts are restricted to numbers 0 to 9.

For users working with Rgui this function don't accept subscripts and just accept superscripts 1, 2 and 3. For more details run the commands:

symbols printed as a "rectangle" don't work in RGui, but these symbols work normally in RStudio.

To see names of symbols use print_greeks.

Value

Returns the desired Greek letter or mathematical symbol in string format.

Author(s)

Kévin Allan Sales Rodrigues.

Examples


# Linear regression
paste("y", " = X", greeks("beta"), " + ", greeks("epsilon"), sep ="")

# pi constant
paste(greeks("pi"), greeks("almostEqual"), "3.14")

# Expected value
paste("E[X] = ", greeks("integral"), "xf(x)dx", sep = "")

greeks("sigma^2")

greeks("Delta^5")

greeks("yourname^9")

# testing statistical hypothesis
paste(greeks("H_0"),":", greeks("mu"), " = 0")
paste("versus", greeks("H_1"), ":", greeks("notEqual"), " 0" )

# returns the Greek letters
paste("The Greek letters", greeks("alpha"), greeks("beta"), "...", greeks("omega"), ".", sep=", ")



greekLetters documentation built on Oct. 17, 2024, 1:06 a.m.