Here we are calling the simplified funnelslice
function using various parameters.
You'll need the devtools package.
devtools::install_github('gmp26/funnel') library(funnel) load("../data/cabg.rda") # if necessary to access cabg data x <- cabg # cabg was created from "inst/extdata/CABG-hospitals-03.csv"
Not so good yet!
par(cex = 0.5) funnelslice(x, plot_title = "Slice", plot = "slice")
Plot.funnel is very fussy about the global value of cex in a way that plot.slice is not. I don't understand how cex is meant to be used in R yet.
par(cex = 1) funnelslice(x, plot_title = "Funnel")
In fact we need a figure size of about 7 inches wide, 6.5 inches high for a reasonable display. There's also an issue with margins in the slice mode.
Plot.slice estimates the margin width for text labels from a character count, but this is rather unreliable when viewed in different ways (Native R plot, exported png image, rescaled etc.) Is there a way to format the hospital label text and measure the required width in advance (e.g. by finding the width of the biggest element.)
funnelslice(x, plot_title = "Slice", plot = "slice")
funnelslice(x, plot_title = "Funnel")
funnelslice(x, plot_title = "Slice", plot = "slice", tails = c(0.01,0.05)) funnelslice(x, plot_title = "Funnel", tails = c(0.01,0.05))
funnelslice(x, plot_title = "Slice", plot = "slice", xlabel = "xlabel", ylabel = "ylabel") funnelslice(x, plot_title = "Funnel", xlabel = "xlabel", ylabel = "ylabel")
funnelslice(x, plot_title = "Slice", plot = "slice",riskadj = T) funnelslice(x, plot_title = "Funnel", riskadj = T)
funnelslice(x, plot_title = "Slice", plot = "slice", RASRplot = T) funnelslice(x, plot_title = "Funnel", RASRplot = T)
funnelslice(x, plot_title = "Slice", plot = "slice", mean.target = F, plot.target = T, ypercent = F) funnelslice(x, plot_title = "Funnel", mean.target = F, plot.target = T, ypercent = F)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.