print: Print free objects

printR Documentation

Print free objects

Description

Print methods for free objects

Usage

## S3 method for class 'free'
print(x,...)
as.character_free(m,latex=getOption("latex"))

Arguments

x

Object of class free in the print method

m

A two-row matrix in function as.character_free()

latex

Boolean, with codeTRUE meaning to print latex-friendly output including curly braces, and default NULL option meaning to give a nicer-looking output that latex would typeset incorrectly

...

Further arguments, currently ignored

Note

The print method does not change the internal representation of a free object, which is a list of integer matrices.

The default print method uses multiplicative notation (powers) which is inconsistent with the juxtaposition method “+”.

The print method has special dispensation for length-zero free objects but these are not handled entirely consistently.

The default print method uses lowercase letters a-z, but it is possible to override this using options(symbols = foo), where foo is a character vector. This is desirable if you have more than 26 symbols, because unallocated symbols appear as NA.

The package will allow the user to set options("symbols") to unhelpful things like rep("a",20) without complaining (but don't actually do it, you crazy fool).

Author(s)

Robin K. S. Hankin

See Also

char_to_free

Examples


## default symbols:

abc(26)
rfree(1,10)


# if we need more than 26:
options(symbols=state.name)
rfree(10,4)

# or even:
jj <- letters[1:10]
options(symbols=apply(expand.grid(jj,jj),1,paste,collapse=""))
rfree(10,10,100,4)

options(symbols=NULL)  #  NULL is interpreted as letters a-z
rfree(10,4)            #  back to normal

freegroup documentation built on Dec. 28, 2022, 2:14 a.m.