getColoursStability: Gets colours for plotting snow stability indices

View source: R/getColoursStability.R

getColoursStabilityR Documentation

Gets colours for plotting snow stability indices

Description

Gets colours for plotting snow stability indices in snowprofiles.

Usage

getColoursStability(
  Values,
  StabilityIndexThreshold = 0.77,
  StabilityIndexRange = c(0, 1),
  invers = FALSE,
  Resolution = 100
)

Arguments

Values

Stability index values

StabilityIndexThreshold

A scalar threshold that defines the transition from medium to poor stability. The color scheme will be adjusted so that this threshold becomes apparent from the colours.

StabilityIndexRange

The range the index spans, e.g. for TSA ⁠[0, 6]⁠, for RTA and p_unstable ⁠[0, 1]⁠, for critical crack length ⁠[0, 3]⁠, etc..

invers

Indices like TSA/ RTA/ p_unstable increase the poorer layer stability gets. For indices with revers behaviour (e.g.,, critical crack length) switch this flag to TRUE.

Resolution

Resolution of colour scale. Default is 100.

Value

Array with HTML colour codes

Author(s)

fherla

See Also

getColoursGrainSize, getColoursGrainType, getColoursHardness, getColoursLWC, getColoursSnowTemp, getColoursPercentage

Examples


p_unstable <- seq(0, 1, by=0.1)
plot(x = rep(1,length(p_unstable)), y = p_unstable,
     col = getColoursStability(p_unstable), pch = 19, cex = 3)

critical_crack_length <- c(seq(0.2, 0.8, by=0.1), 1.5, 2.5)
plot(x = rep(1,length(critical_crack_length)), y = critical_crack_length, pch = 19, cex = 3,
     col = getColoursStability(critical_crack_length, StabilityIndexThreshold = 0.4,
                               StabilityIndexRange = c(0, 3), invers = TRUE))


sarp.snowprofile documentation built on March 31, 2023, 5:17 p.m.