Nothing
new_sgl_geom_bar <- function() {
new_sgl_geom(class = "sgl_geom_bar")
}
#' @export
geom_name.sgl_geom_bar <- function(geom) {
"bar"
}
#' @export
ggplot_geom.sgl_geom_bar <- function(geom) {
ggplot2::geom_bar
}
#' @export
valid_non_pos_aes.sgl_geom_bar <- function(geom) {
"color"
}
#' @export
ggplot_aes.sgl_geom_bar <- function(geom, layer, df, scales) {
ggplot_aes_mapping <- NextMethod()
if ("colour" %in% names(ggplot_aes_mapping)) {
names(ggplot_aes_mapping)[names(ggplot_aes_mapping) == "colour"] <- "fill"
}
ggplot_aes_mapping
}
#' @export
valid_qual_list.sgl_geom_bar <- function(geom) {
c(
"horizontal",
"unstacked",
"vertical"
)
}
#' @export
has_direction.sgl_geom_bar <- function(geom) {
TRUE
}
#' @export
ggplot_dir_from_qual.sgl_geom_bar <- function(geom, qual) {
if (qual == "vertical") {
return("x")
}
"y"
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.