lf_lf: Linear function: f(x) = y = mx+b

View source: R/Linear_functions.R

lf_lfR Documentation

Linear function: f(x) = y = mx+b

Description

Calculate y for given linear function(s).

The parameter(s) slope m and the intercept b can be supplied either by a set(s) of parameter cbind(m,b) or by a vector of parameter = m and a second (additional) argument vector of ... = b.

Usage

lf_lf(x, parameter, ...)

Arguments

x

vector

parameter

Either vector, matrix or data.frame with parameter set ⁠m,b⁠ or just the slope m. It is also possible to supply a matrix as a set of parameter where each row represents c(m,b).

...

vector of intercept(s) b

Details

The function calculates y for given vector x with the parameter,(...) supplied.

Value

vector or matrix of y values foreach m,b definition

Author(s)

Florian Wagner florian.wagner@wagnius.ch

Examples

lf_lf(-5:5,0.8,3.265)
lf_lf(-5:5,c(1,3))
df <- data.frame(x = c(0.5,1,-0.5), y = c(1,0,-1))
lf_lf(-5:5,df)

wagnius-GmbH/slvwagner documentation built on Jan. 19, 2025, 7:10 a.m.