showMonomialXYZ function

Print a monomial

Print a monomial

Prints a monomial like "x.z^2" if possible (see details).

showMonomialXYZ(letters = c("x", "y", "z"), collapse = ".")

Arguments

  • letters: a vector of strings, usually some letters such as "x"

    and "y", to denote the variables

  • collapse: a string to denote the symbol representing the multiplication, e.g. "*" or "."

Returns

A function which takes as argument a sequence of exponents and which prints the corresponding monomial.

Details

If the function returned by this function is applied to a vector of exponents whose length is higher than the length of the letters

vector, then showMonomialX1X2X3(x=letters[1]) is applied (see the last example).

Note

The function returned by this function can be used as the option "showMonomial" in the showQsprayOption<- function.

Examples

showMonomialXYZ()(c(1, 0, 2)) showMonomialXYZ(collapse = "*")(c(1, 0, 2)) showMonomialXYZ()(NULL) # what happens if there are more exponents than letters: showMonomialXYZ(c("a", "b"), collapse = "*")(c(1, 2, 3)) # same as: showMonomialX1X2X3("a", collapse = "*")(c(1, 2, 3)) # setting a show option: set.seed(3141) ( qspray <- rQspray() ) showQsprayOption(qspray, "showMonomial") <- showMonomialXYZ(c("A", "B", "C")) qspray # this is equivalent to: showQsprayOption(qspray, "showQspray") <- showQsprayXYZ(c("A", "B", "C"))

See Also

showQsprayXYZ, showMonomialX1X2X3, showQsprayOption<-.

  • Maintainer: Stéphane Laurent
  • License: GPL-3
  • Last published: 2024-07-27