throwchart {DataViz}R Documentation

~ Main function: throwchart ~

Description

Throwchart method is useful for visualising paired data, such as before/after data sets. Each pair of points are set on a horizontal axis and joined by a parabola. The height of the parabola is proportional to the difference: after- before = difference. If the difference is negative (after < before) then the curve is drawn under the axis.

Usage

throwchart(before, after, col, id, lwd, xlim, ylim, offSet, webinteract)

Arguments

before

[numeric] or [integer]: A (non-empty) vector of data values.

after

[numeric] or [integer]: A (non-empty) vector of data values.

col

[character]: A vector of hex code colours, by default "#123".

id

[factor]: Column of string or number identifiers.

lwd

[integer]: Line width, a column of line widths, by default value is 2.5.

xlim

[numeric]: 2 value colum with x limits.

ylim

[numeric]: 2 value colum with y limits.

offSet

[integer]: Single value offset for the graph.

webinteract

[bool]: Is the function used in interactive mode?

Examples

  if(interactive()){
  	throwchart(c(1,2),c(2,8),c("#000","#F82"),id = c("id1","id2"),c(1,5))
  	throwchart(c(1,2),c(2,8), offSet = 1, webinteract=TRUE)
  }
  if(!interactive()){
        throwchart(c(1,2),c(2,8), offSet = 1, webinteract=FALSE)
        throwchart(c(1,2),c(2,1), webinteract=FALSE)
        throwchart(c(1,2),c(2,8),c("#000","#F00"),id = c("id1","id2"),c(1,5), webinteract=FALSE)
	n <- 10
	Avant <- rnorm(n)
	Apres <- Avant + rnorm(n) + 10
	throwchart(Avant, Apres, xlim =  c(-4,14), webinteract = FALSE)
	throwchart(Avant, Apres, offSet = 0, webinteract = FALSE)
	throwchart(Avant, Apres, offSet = 8, webinteract = FALSE)
  }

[Package DataViz version 0.2.8 Index]