positionTextBoxDriverDriverDriver {textBoxPlacement}R Documentation

positionTextBoxDriverDriverDriver

Description

Driver invoke positionTextBoxDriverDriver() using the original user input data If that fails to produce an uncluttered plot, then invokes stagger() to reshape the data before re-running positionTextBoxDriverDriver().

Usage

positionTextBoxDriverDriverDriver(
  xList,
  yList,
  textList,
  xPos,
  nApprox = 10,
  labs,
  sortB,
  verbose = FALSE
)

Arguments

xList

(optional) list whose components are numeric vectors of the x values for overlaid curves

yList

list whose components are numeric vectors of the y values for overlaid curves

textList

(optional) list of character string texts to insert in plot

xPos

(optional) numeric vector x position for text box

nApprox

(optional) integer number of intervals to interpolate between x data points

labs

(optional) list of labels annotating a graph

  • main character string main title

  • xlab character string x axis label

  • ylab character string y axis label

sortB

Boolean if TRUE staggered curves reordered, with largest range curve on bottom of graph

verbose

Boolean if TRUE print informative or diagnostic messages to console

Details

if xList or textList is missing, it is constructed from elements in yList

hint: to prevent conflicts, run the following line manually before running positionTextBoxDriverDriverDriver()

rm(list=ls())

see https://stackoverflow.com/questions/27253376/different-results-from-rscript-and-r-cmd-batch

Value

returns no values, but has side effect of generating a graph.

Examples

# There is not enough space for text boxes in original graph.
# The package automatically adds offsets to the curves,
# keeping the curves in the original order,
# and successfully adds text boxes

positionTextBoxDriverDriverDriver(xList=xList1,yList=yList1,
  textList=textList,xPos=c(1,1,1),nApprox=10,labs=labs,sortB=FALSE)

# data set contains some negative values

positionTextBoxDriverDriverDriver(xList=xList2,yList=yList2,
  textList=textList,xPos=c(1,1,1),nApprox=10,labs=labs,sortB=FALSE)

# show the difference when we sort the order of the curves
# to position the curve with the largest range on the bottom

positionTextBoxDriverDriverDriver(xList=xList2,yList=yList2,
  textList=textList,xPos=c(1,1,1),nApprox=10,labs=labs,sortB=TRUE,verbose=TRUE)
  

[Package textBoxPlacement version 1.0 Index]