Skip to contents

Suggests a alpha opacity to plot with as a function of the number of observation.

Usage

linear_tform(n, appox_max_n = 5000, ceiling = 1, floor = 0.3)

Arguments

n

Number of observations to plot.

appox_max_n

The number of observation to reach floor opacity.

ceiling

The highest number returned. Defaults to 1.

floor

The lowest number returned. Defaults to 0.3.

Value

A scalar numeric, suggested value to set alpha opacity.

Examples

library(cheem)

## Suggest an opacity to use in plotting:
(my_alpha <- linear_tform(nrow(spinifex::penguins_na.rm)))
#> [1] 0.95338

## Visualize
x <- 1:2000
plot(x, sapply(x, linear_tform), col = "blue")