Created
July 19, 2016 21:36
-
-
Save sebastiansauer/586e042735812eceee642f03e9abf00a to your computer and use it in GitHub Desktop.
logistic (sigmoid) curve with ggplot2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
# library(cowplot) | |
library(dplyr) | |
logist <- function(x){ | |
y = exp(x) / (1 + exp(x)) | |
} | |
p1 <- ggplot(data_frame()) | |
p1 + stat_function(aes(-5:5), fun = logist) + xlab("x") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
stats::plogis can be used.