ClearScatterplot Example

Example Usage of ClearScatterplot

This vignette demonstrates how to use MultiModalGraphics to create a ClearScatterplot visualization.

# Load required libraries
library(MultiModalGraphics)

# Load the data
file_path <- system.file("extdata", "scatterexample.csv", package = "MultiModalGraphics")
filtered_data <- read.csv(file_path)

# Transform and set up for plot
filtered_data$negLog10p <- -log10(filtered_data$p)
filtered_data$negLog10q <- -log10(filtered_data$q)

# Create the ClearScatterplot instance
scattered_plot <- ClearScatterplot(
  data = filtered_data,
  logFoldChange = "log2fc",
  timePointColumn = "timePoint"
)

# Generate the plot
scattered_plot <- createPlot(
  scattered_plot,
  color1 = "cornflowerblue",
  color2 = "grey",
  color3 = "indianred",
  highLog2fc = 0.585,
  lowLog2fc = -0.585,
  expressionDirection = "regulation",
  timeVariable = "reg_time_org"
)
## Scale for colour is already present.
## Adding another scale for colour, which will replace the existing scale.
# Display the plot
scattered_plot