Skip to contents

This function generates a plot for GD2 scores using different plot types (scatter, box, violin). It also allows highlighting specific groups within the plot.

Usage

plotGD2Score(
  df,
  plot_type = "scatter",
  Group.1 = NULL,
  group_title = "",
  colors = NULL,
  HighlightGroup = ""
)

Arguments

df

A data frame containing the data to be plotted. Must include columns 'Score' and 'Group'.

plot_type

A character string specifying the type of plot to be generated. Can be "scatter", "box", or "violin". Default is "scatter".

Group.1

A character vector specifying the order of the groups to be displayed on the axis.

group_title

A character string specifying the title for the group axis.

colors

A vector of colors to be used for the groups.

HighlightGroup

A character vector specifying the groups to be highlighted in the plot.

Value

A plotly object representing the generated plot.

Examples

plot_df <- data.frame(
  Score = c(1.5, 2.3, 3.6, 4.8),
  Group = c("A", "B", "A", "C")
)
Group.1 <- c("A", "B", "C")
group_title <- "Groups"
colors <- c("blue", "green", "orange")
HighlightGroup <- c("B", "C")

fig <- plotGD2Score(plot_df, "scatter", Group.1, group_title, colors, HighlightGroup)
fig