knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The freegroup
package provides functionality for working with
the free group in R. A detailed vignette is provided in the package.
Informally, the free group is the set $X$ of words that are
objects like $W=c^{-4}bb^2aa^{-1}ca$, with a group operation of string
juxtaposition. Usually one works only with words that are in
``reduced form'', which has successive powers of the same symbol
combined, so $W$ would be equal to $c^{-4}b^3ca$; see how $b$ appears
to the third power and the $a$ term in the middle has vanished.
The group operation of juxtaposition is formally indicated by $\circ$, but this is often omitted in algebraic notation; thus, for example $a^2b^{-3}c^2\circ c^{-2}ba =a^2b^{-3}c^2c{^-2}ba =a^2b^{-2}ba$.
You can install the released version of freegroup from CRAN with:
# install.packages("freegroup") # uncomment this to install the package library("freegroup")
freegroup
package in useFunction rfree()
generates a vector of random free group
elements, giving quick "get you going" examples:
set.seed(0)
a <- rfree(10,5) a b <- as.free('x')
Then we can perform various operations on these vectors:
a+b a-b a^b
There are a number of package functions that work in a vectorized way:
sum(a)
The package also supports extraction and replacement:
a[3:9] <- as.free('xy') a
Various simple elements can be created:
alpha(1:10) abc(1:5)
For more detail, see the package vignette
vignette("freegroup")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.