#' Plot Value by DRG Codes
#'
#' @param data
#' @param vary
#'
#' @return plot
#' @export
#'
#' @import dplyr
#' @import ggplot2
#'
#' @examples plot_DRG(DRG_data,'Average.Medicare.Payments')
#'
#'
boxplot.drg <- function(data, vary){
data <- preprocess(data)
ggplot(data, aes(x = DRG, y = get(vary))) +
scale_y_continuous(trans='log10') + geom_boxplot(outlier.shape = NA) +
theme(axis.text.x = element_text(angle = 90, size = 6, hjust = 1)) +
ylab(vary) +
xlab('DRG Code') +
ggtitle(paste(vary, 'Hospitals by DRG Code'))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.