MyNixOS website logo
Description

Simplified Plotting for Data Exploration.

Automates common plotting tasks to ease data exploration. Makes density plots (potentially overlaid on histograms), scatter plots with prediction lines, or bar or line plots with error bars. For each type, y, or x and y variables can be plotted at levels of other variables, all with minimal specification.

splot

An R package to ease data visualization.

The aim of this package is to make visualization an early part of the data analysis process by automating a few common plotting tasks.

In terms of design, it has three general principles:

  • Flexibility: splot prefers to try to make a reasonable plot from any input, rather than erroring out.
  • Minimal specification: You should be able to make most plots with just a formula input, and the same formula should generally be compatible with multiple plot types, regardless of variable types.
  • Tweakability: Though splot is focused on quick, automated plotting, you should be able to adjust any aspect of the display with additional arguments, if you find a plot you want to display elsewhere.

features

By entering a formula as the first argument in the splot function (e.g., splot(y ~ x)), you can make

  • Density distributions (overlaid on histograms when there is no by variable)
  • Scatter plots with prediction lines
  • Bar or line graphs with error bars

For each type, multiple y variables or data at levels of a by variable are shown in the same plot frame,
and data at levels of one or two between variables are shown in separate plot frames, organized in a grid.

resources

installation

Download R from r-project.org.

Release (version 0.5.4)

install.packages("splot")

Development (version 0.5.5)

# install.packages("remotes")
remotes::install_github("miserman/splot")

Then load the package:

library(splot)

examples

Make some data: random group and x variables, and a y variable related to x:

group = rep(c("group 1", "group 2"), 50)
x = rnorm(100)
y = x * .5 + rnorm(100)

The distribution of y:

splot(y)

A scatter plot between y and x:

splot(y ~ x)

Same data with a quadratic model:

splot(y ~ x + x^2 + x^3)

Same data separated by group:

splot(y ~ x * group)

Could also separate by median or standard deviations of x:

splot(y ~ x * x)
splot(y ~ x * x, split = "sd")

Summarize with a bar plot:

splot(y ~ x * group, type = "bar")

Two-level y variable with a probability prediction line:

# make some new data for this example:
# a discrete y variable and related x variable:
y_bin = rep(c(1, 5), 50)
x_con = y_bin * .4 + rnorm(100)

# lines = "prob" for a prediction line from a logistic model:
splot(y_bin ~ x_con, lines = "prob")
Metadata

Version

0.5.4

License

Unknown

Platforms (75)

    Darwin
    FreeBSD 13
    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-freebsd13
  • 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-freebsd13
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows