mosaicize: Prepare a Mosaic plot of two columns in long format.

Description Usage Arguments Details Value Examples

View source: R/fcn_misc.R

Description

Found at http://stackoverflow.com/questions/19233365/how-to-create-a-marimekko-mosaic-plot-in-ggplot2 Modified (e.g. to pass R check)

Usage

1

Arguments

data

A data.frame with exactly two columns

Details

Returns a data frame, which can be used for plotting and has the following columns: 'Var1' - marginalized values from 1st input column 'Var2' - marginalized values from 2nd input column 'Freq' - relative frequency of the combination given in [Var1, Var2] 'margin_var1' - frequency of the value given in Var1 'var2_height' - frequency of the value given in Var2, relative to Var1 'var1_center' - X-position when plotting (large sets get a larger share)

Value

Data.frame

Examples

1
2
3
4
5
  data = data.frame(raw.file = c(rep('file A', 100), rep('file B', 40)),
                    charge = c(rep(2, 60), rep(3, 30), rep(4, 10),
                               rep(2, 30), rep(3, 7), rep(4, 3)))
  mosaicize(data)                             
  

PTXQC documentation built on June 10, 2017, 1:03 a.m.

Search within the PTXQC package
Search all R packages, documentation and source code