sigmoid.R 469 B

12345678910111213141516171819
  1. #!/usr/bin/env Rscript
  2. library(magrittr)
  3. library(tibble)
  4. library(dplyr)
  5. library(ggplot2)
  6. library(rctutils)
  7. sigdata <- tibble(
  8. beta = seq(from=1e-6, to=1-1e-6, length.out=500),
  9. m = log2( beta / (1 - beta)))
  10. p <- ggplot(sigdata) +
  11. aes(y = m, x = beta) +
  12. geom_line() +
  13. coord_cartesian(ylim = c(-6, 6), xlim = c(0, 1)) +
  14. theme_bw() +
  15. ylab("M-value") + xlab(expression(paste(beta, "-value")))
  16. ggprint(p, pdf("sigmoid.pdf", width=6, height=8))