Generate a Ternary Plot with Customizable Axis Labels
ternaryPlot.Rd
This function generates a ternary plot using the ggtern package with customizable axis labels. The function allows specifying the variable names for the x, y, and z axes. It also capitalizes the first letter of each variable name for axis labels.
Argumentos
- data
A data frame containing the data to be plotted.
- xvar
The name of the variable to be plotted in the x-axis of the ternary plot.
- yvar
The name of the variable to be plotted in the y-axis of the ternary plot.
- zvar
The name of the variable to be plotted in the z-axis of the ternary plot.
- bsize
The base font size for the plot.
- point_size
The size of the points.
- ...
others ggplot parameters
Detalles
This function creates a ternary plot, where data points are represented
by points in a triangular coordinate system. The xvar
, yvar
, and zvar
arguments allow you to specify which variables from the data
argument should
be used for each axis. The function also capitalizes the first letter of each
variable name for use in the axis labels. You can adjust the base font size
(bsize
) for the plot to control the text size.
Ejemplos
if (FALSE) { # \dontrun{
# Example usage of the custom function with customized variable names
data <- data.frame(
arena = c(0.4, 0.3, 0.2, 0.1),
arcilla = c(0.3, 0.4, 0.2, 0.1),
limo = c(0.3, 0.3, 0.4, 0.1)
)
ternaryPlot(data, xvar = 'arena', yvar = 'arcilla',
zvar = 'limo')
} # }