Skip to content

Instantly share code, notes, and snippets.

@rrodrigueznt
Created March 13, 2018 14:43
Show Gist options
  • Save rrodrigueznt/23bd6d083719788ee373804642370be2 to your computer and use it in GitHub Desktop.
Save rrodrigueznt/23bd6d083719788ee373804642370be2 to your computer and use it in GitHub Desktop.
mod = function(x) {if (x < 0) {mod <- x*(-1)} else {mod <- x}}
f = function(x) {f <- mod(x)/x}
x <- seq(-1,1,0.01)
x
y <- f(x)
y
plot(f,xlim = c(-1,1))
remove(x,y,f,mod)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment