File:Geom bar1.png: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

15 December 2022

  • curprev 14:3914:39, 15 December 2022Brb talk contribs 2,034 bytes +2,034 <pre> library(ggplot2) library(scales) library(patchwork) dtf <- data.frame(x = c("ETB", "PMA", "PER", "KON", "TRA", "DDR", "BUM", "MAT", "HED", "EXP"), y = c(.02, .11, -.01, -.03, -.03, .02, .1, -.01, -.02, 0.06)) set.seed(1) dtf2 <- data.frame(x = dtf[, 1], y = sample(dtf[, 2])) g1 <- ggplot(dtf, aes(x, y)) + geom_bar(stat = "identity", aes(fill = x)) + geom_text(aes(label = paste0(y * 100, "%"), hjust = ifelse(y >= 0,...