MyNixOS website logo
Description
Trace and Highlight Groups of Data Points
Provides 'ggplot2' geoms that allow groups of data points to be outlined or highlighted for emphasis. This is particularly useful when working with dense datasets that are prone to overplotting.

ggtrace

R-CMD-check Codecov testcoverage

ggtrace provides ggplot2 geoms that allow groups of data points to be outlined or highlighted for emphasis. This is particularly useful when working with dense datasets that are prone to overplotting.


Installation

You can install the released version from CRAN:

install.packages("ggtrace")

and the development version from GitHub:

devtools::install_github("rnabioco/ggtrace")

Basic Usage

geom_point_trace() accepts graphical parameters normally passed to ggplot2::geom_point() to control the appearance of data points and outlines. The trace_position argument can be used to select specific sets of points to highlight. For more examples see the vignette.

library(ggplot2)
library(ggtrace)

ggplot(clusters, aes(UMAP_1, UMAP_2, color = cluster)) +
  geom_point_trace(
    trace_position    = signal < 0,
    fill              = "white",
    background_params = list(color = NA, fill = "grey85")
  ) +
  theme_minimal()

geom_line_trace() accepts parameters normally passed to ggplot2::geom_line() with the following exceptions: fill controls the inner line color, color controls the outline color, and stroke controls outline width. Like geom_point_trace(), the trace_position argument can be used to select specific data points to highlight. For more examples see the vignette.

ggplot(stocks, aes(day, value, color = name)) +
  geom_line_trace(
    trace_position    = day < 500 | day > 1500,
    stroke            = 1,
    background_params = list(color = NA, fill = "grey75")
  ) +
  theme_minimal()
Metadata

Version

0.2.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows