Learn R Programming

nlsic (version 1.2.0)

equa2vecmat: Parse linear equations/inequalities

Description

parse a text vector of linear equations and produce a corresponding matrix and right hand side vector

Usage

equa2vecmat(nm_par, linear, sep = "=")

Value

an augmented matrix. Its first column is the rhs vector. Other columns are named by nm_par. If the vector linear is NULL or its content is empty a NULL is returned

Arguments

nm_par

a string vector of variable names. It will be used in the symbolic derivation.

linear

string vector of linear equations like "a+2*c+3*b = 0"

sep

separator of two parts of equations. Use for example ">=" for linear inequalities

Examples

Run this code
equa2vecmat(c("a", "b", "c"), "a+2*c+3*b = 0", "=")

Run the code above in your browser using DataLab