OW.tornado: Tornado Diagram for One-Way Sensitivity Analysis

Description Usage Arguments Value Examples

View source: R/OW Tornado diagram.R

Description

Output is a tornado diagram for SDM sensativity analysis.

Usage

1
2
OW.tornado(data = NULL, best.outcome = max, x.axis.title = "Utility",
  xlim.big = NULL, xlim.small = NULL)

Arguments

data

dater frame or matrix containing decision, utility, parm (parameter), pct (increment) as column names.

best.outcome

either max or min. Represents whether the utility is optimized at minimum or maximun values.

x.axis.title

self explanitory

xlim.big

optional input to fine tine the upper limit of the x axais in it gets weird

xlim.small

similar to xlim.big

Value

Returns a barplot in the form of a tornado diagram I tested this for the most part but I bet it will throwup on me at some point. I'll keep updating the codez until it holds them down. Uses the nicenumbs funciton in the BrignonPackage for sexy axis plotting. Requires installing the gplots and Hmisc packages.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
##Lets make some fake dater called infile
decision = seq(1,2,1)
parm = paste("parm",seq(1,25,1))
pct = seq(0.05,0.95,length.out = 10)
utility = sample(rnorm(1,0,50):runif(1,50,500),500,replace = T)
infile = cbind(expand.grid(decision=decision,parm = parm,pct = pct),utility = utility)

##Open seperate plotting window and make da plot
x11()
OW.tornado(infile,best.outcome = max,x.axis.title = "Coach Ditka's rating on Madden 1985")

##Save plot to directory
png(file="~/one way sensativity output.png",width = 1000,height = 800,res = 100)
OW.tornado(infile,best.outcome = max,x.axis.title = "Coach Ditka's rating on Madden 1985")
dev.off()

wrbrignon/BrignonPackage documentation built on May 4, 2019, 10:54 a.m.