Create a Biplot with Linear Regression and Statistical Annotations
create_analysis_biplot.Rd
This function creates a biplot using the `plotly` library that displays a scatterplot of two metrics from a given dataframe, fits a linear regression line, and shows key statistical measures (correlation, R², p-value) in a floating text box.
Arguments
- df
A data frame containing the metrics to be plotted.
- metric_x
A string specifying the name of the x-axis metric (column in the dataframe).
- metric_y
A string specifying the name of the y-axis metric (column in the dataframe).
- classes
A boolean indicating whether to group the data by a categorical variable.
- lm
A boolean indicating whether to add a linear regression line.