Learn R Programming

editrules (version 2.0-3)

editrules: Retrieve readables editrules from an editmatrix

Description

editrules returns a data.frame describing the editrules in editmatrix x. This data.frame can be used to store the editrules in a readable format, so that the editrules can be maintained and documented.

Usage

editrules(x)

Arguments

x
editmatrix or matrix object

Value

  • data.frame with information on all edit rules / constraints

Details

The editmatrix function can use the output of editrules to create an editmatrix.

If x is a normal matrix, the matrix will be coerced to an editmatrix. The columns of the matrix are the variables and the rows are the edit rules (constraints).

See Also

editmatrix

Examples

Run this code
E <- editmatrix(c( "x+3*y == 2*z"
                 , "x > 2")
                 )
print(E)
                 
# get editrules, useful for storing and maintaining the rules external from your script
editrules(E)
                 
# get coeficient matrix of inequalities
getA(E)

# get augmented matrix of linear edit set
getAb(E)

# get constants of inequalities (i.e. c(0, 2))                
getb(E)

# get operators of inequalities (i.e. c("==",">"))
getOps(E)

# get variables of inequalities (i.e. c("x","y","z"))
getVars(E)

# isNormalized
isNormalized(E)

#normalized E
E <- normalize(E)
E

# is het now normalized?
isNormalized(E)

Run the code above in your browser using DataLab