slope.diff: Slope difference

View source: R/slope.diff.R

slope.diffR Documentation

Slope difference

Description

Measuring the difference between slopes in angles

Usage

slope.diff(slope1, slope2, angle = "degree", significance)

Arguments

slope1

A slope.

slope2

Another slope.

angle

Either "degree" (default) or "radian".

significance

Optional, an angle value below which angles are not significant (in degree or radian)

Value

Either the value of the angle (if significance is left empty) or a logical whether the angle is below the significance value.

Author(s)

Thomas Guillerme and Ariel Marcy

Examples

## A random dataset
data <- as.data.frame(replicate(3, rnorm(10)))
colnames(data) <- letters[1:3]

## Two slopes
slope_b <- lm(a ~ b, data)$coefficients[["b"]]
slope_c <- lm(a ~ c, data)$coefficients[["c"]]

## The slope difference
slope.diff(slope_b, slope_c)
## The slope difference in radian
slope.diff(slope_b, slope_c, angle = "radian")
## Whether the slope difference is lower than 4.5 degrees
slope.diff(slope_b, slope_c, significance = 4.5)


TGuillerme/landvR documentation built on July 4, 2025, 10:16 p.m.