Description Usage Arguments Value Examples
View source: R/OW Tornado diagram.R
Output is a tornado diagram for SDM sensativity analysis.
1 2 |
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 |
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.
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()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.