Instantly share code, notes, and snippets.

Embed
What would you like to do?
mt
gx <- function(x){
x[-2>x | x>2] <-NA
1/2*cos(6*x)+7/2
}
fx <- function(x){
x[x<(-1)] <- NA
x[x>1] <- NA
x^4-x^2+6
}
sx <- function(x){
x[-1<x & x<1] <-NA
12/(abs(x)+1)
}
ggplot(data.frame(x=c(-7,7),y=0), aes(x,y))+stat_function(fun=gx) +stat_function(fun=fx)+stat_function(fun=sx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment