Skip to contents

Equation(lhs, rhs) builds the equation lhs ~ rhs. Every function that takes equations also accepts R formulas, so D(x) ~ -k * x can be written directly in a list(); both sides of a formula are evaluated in the environment where the formula was created.

Usage

Equation(lhs, rhs)

as_equation(x)

Arguments

lhs, rhs

Expressions or numbers.

x

A formula, an Equation, or a list of them.

Value

An object of class Equation.

Examples

t <- t_nounits; D <- D_nounits
x <- Variable("x", t); k <- Parameter("k")
Equation(D(x), -k * x)
#> Derivative(x(t), t) ~ -k*x(t) 
as_equation(D(x) ~ -k * x)
#> Derivative(x(t), t) ~ -k*x(t)