An Enhanced Chart for Simple and Truthful Representation of Single Observations over Multiple Classes

The sinaplot is a data visualization chart suitable for plotting any single variable in a multiclass data set. It is an enhanced jitter strip chart, where the width of the jitter is controlled by the density distribution of the data within each class.


Build Status CRAN_Status_Badge CRAN_Downloads_Badge

The sinaplot is a data visualization chart suitable for plotting any single variable in a multiclass dataset. It is an enhanced jitter strip chart, where the width of the jitter is controlled by the density distribution of the data within each class.

Installation

Get the released version from CRAN:

install.packages("sinaplot")

Or the development version from github:

# install.packages("devtools")
devtools::install_github("sidiropoulos/sinaplot")

Webserver

In order to aid users without experience in R we also provide access to a webserver accepting excel sheets to produce the plots.

News

sinaplot NEWS

Changes in version 1.1.0 (2017-04-10)

  • Major fucntional update. Sinaplot now works with data frames, lists, numeric vectors and formulas, similar to boxplot and beeswarm.

  • Method "density" (default) no longer bins the y-axis on based on the supplied "bins" parameter. Instead the inferred bins from function "density()" are used.

  • A random seed is added as an optional argument and can be used to control the random sample jittering and allow for plot reproducibility.

  • NA's are automatically removed. A warning is thrown if NA values are present in the data informing about the number of cases removed.

  • "labels" parameter controls the x-axis labels. Label rotation is removed. It is up to the user to control the label appearance.

  • sinaplot returns an invisible object regardless of "plot" parameter. "bin_count" column is removed from the output.

  • "color" is renamed to "col" to maintain consistency with 'graphics' functions.

  • "col" and "pch" can be used and recycled if necessary to control the color and the shape of the points respectively.

  • sinaplot can be added on top of other plots (i.e. boxplot) by using the 'add' parameter.

================================================================================

Changes in version 1.0.0 (2016-10-11)

  • Major graphic update. SinaPlot now uses "base" graphics instead of ggplot2. geom_sina() is now part of ggforce (https://github.com/thomasp85/ggforce), an extention of ggplot2, and can be used to produce sinaplots with ggplot2.

  • Major functional update. Several parameters have been added, renamed, replaced or removed. Read below for details.

    Added:

    • "maxwidth" confines the spread of the samples along the x-axis. 0 is equivalent to no spread, 1 allows for maximum spread.
    • Any argument can be passed to plot(), e.g. "cex" = 0.8, "pch" = 20, etc.

    Renamed:

    • Method "neighbourhood" is renamed to "counts".
    • "neighbLimit" is renamed to "bin_limit".
    • "groupwiseScale" is renamed to "scale".

    Replaced:

    • "yFraction" is replaced with "bins". Instead of specifying the fraction of the data range for each bin, now you provide the number of bins.

    Removed:

    • "xSpread".
    • "labels" .
    • "main", "bw", "shape" and "size".
  • If "plot == FALSE" the function returns a data frame with columns:

    x: discrete x-coordinates, split by group y: input values group: input groups bin_count: number of samples per bin per group scaled: final x-coordinates, adjusted by the sinaplot method

================================================================================

Changes in version 0.1.6 (2016-07-08)

  • Fixed a bug where having samples values overlapping the outermost y-bin boundaries produced an error (thanks to John Hoch).

Changes in version 0.1.5 (2016-05-14)

  • Fixed a bug that was plotting the first and last classes beyond the figure margins.

Changes in version 0.1.4 (2016-04-19)

  • Fixed a bug where the data were reordered after calculating the new x-axis coordinates. This was creating problems when a user wanted to plot the samples with custom colors using sinaplot() + geom_point(col = mycol).

Changes in version 0.1.3 (2015-11-20)

  • "groups" are treated as factors and they are plotted in the order that their levels appear (alphabetically by default) providing a similar output format with default ggplot2 plots.

Changes in version 0.1.2 (2015-10-02)

  • NEWS file added.
  • Changes in vignette compiling. knitr is added as the vignette builder in the DESCRIPTION FILE.
  • Author details edited.
  • Removed redundant "inst/temp.R" file.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("sinaplot")

1.1.0 by Nikos Sidiropoulos, a year ago


Browse source code at https://github.com/cran/sinaplot


Authors: Nikos Sidiropoulos [aut, cre], Sina Hadi Sohi [aut], Nicolas Rapin [aut], Frederik Otzen Bagger [aut]


Documentation:   PDF Manual  


GPL (>= 2) license


Depends on plyr

Suggests rmarkdown, knitr, RColorBrewer


See at CRAN