dotplot: Create Dotplot for Neurocognitive Domains This function...

View source: R/plots.R

dotplotR Documentation

Create Dotplot for Neurocognitive Domains This function generates a dotplot for neurocognitive and neurobehavioral domains.

Description

Create Dotplot for Neurocognitive Domains This function generates a dotplot for neurocognitive and neurobehavioral domains.

Usage

dotplot(
  data,
  x,
  y,
  linewidth = 0.5,
  fill = x,
  shape = 21,
  point_size = 6,
  line_color = "black",
  colors = NULL,
  theme = "fivethirtyeight",
  return_plot = NULL,
  filename = NULL,
  ...
)

Arguments

data

The dataset or df containing the data for the dotplot.

x

The column name in the data frame for the x-axis variable, typically the mean z-score for a cognitive domain.

y

The column name in the data frame for the y-axis variable, typically the cognitive domain to plot.

linewidth

The width of the line, Default: 0.5

fill

The fill color for the points, Default: x-axis variable

shape

The shape of the points, Default: 21

point_size

The size of the points, Default: 6

line_color

The color of the lines, Default: 'black'

colors

A vector of colors for fill gradient, Default: NULL (uses pre-defined color palette)

theme

The ggplot theme to be used, Default: 'fivethirtyeight'. Other options include 'minimal' and 'classic'

return_plot

Whether to return the plot object, Default: TRUE

filename

The filename to save the plot to, Default: NULL

...

Additional arguments to be passed to the function.

Value

An object of class 'ggplot' representing the dotplot.


jtrampush/npsych.data documentation built on Feb. 25, 2025, 12:30 a.m.