|
a |
|
b/man/adjust_alpha_scale.Rd |
|
|
1 |
% Generated by roxygen2: do not edit by hand |
|
|
2 |
% Please edit documentation in R/AdjustAlphaScale.R |
|
|
3 |
\name{adjust_alpha_scale} |
|
|
4 |
\alias{adjust_alpha_scale} |
|
|
5 |
\title{Adjust Alpha Scale for Data Visualization} |
|
|
6 |
\usage{ |
|
|
7 |
adjust_alpha_scale(data, name, range = c(0.2, 0.8)) |
|
|
8 |
} |
|
|
9 |
\arguments{ |
|
|
10 |
\item{data}{A data frame containing the values for which the alpha scale is to be adjusted.} |
|
|
11 |
|
|
|
12 |
\item{name}{Character string that will be used as the title of the legend in the plot.} |
|
|
13 |
|
|
|
14 |
\item{range}{Numeric vector of length 2 specifying the range of alpha values, defaults to c(0.2, 0.8).} |
|
|
15 |
} |
|
|
16 |
\value{ |
|
|
17 |
A ggplot2 alpha scale adjustment layer. |
|
|
18 |
} |
|
|
19 |
\description{ |
|
|
20 |
This function dynamically adjusts the transparency scale for visualizations, |
|
|
21 |
especially useful when the range of data values varies significantly across different sources. |
|
|
22 |
It modifies the transparency scale based on the range of values present in the data, |
|
|
23 |
ensuring that the visualization accurately reflects variations within the data. |
|
|
24 |
} |
|
|
25 |
\examples{ |
|
|
26 |
# Assuming 'data' is a DataFrame with a 'value' column |
|
|
27 |
plot_data <- data.frame(value = c(10, 20, 30, 40, 50)) |
|
|
28 |
ggplot2::ggplot(plot_data, ggplot2::aes(x = 1:nrow(plot_data), y = value)) + |
|
|
29 |
ggplot2::geom_point(ggplot2::aes(alpha = value)) + |
|
|
30 |
adjust_alpha_scale(plot_data, "Transparency Scale") |
|
|
31 |
|
|
|
32 |
} |