get_f_from_points: Get the function of a line from two points

View source: R/exported_functions.R

get_f_from_pointsR Documentation

Get the function of a line from two points

Description

get_f_from_points() returns a function that can be used to generate any points on a given line.

Usage

get_f_from_points(a, b)

Arguments

a

a vector containing two (and only two) points corresponding to x and y.

b

a vector containing two (and only two) points corresponding to x and y.

Value

a function that returns $y$ for any $x$ on the line.

Examples

get_f_from_points(c(0, 0), c(1, 3))

firthj/oneliners documentation built on June 29, 2022, 11:19 p.m.