Skip to content

Instantly share code, notes, and snippets.

@leozc
Last active August 29, 2015 14:24
Show Gist options
  • Save leozc/6451baec171c3aad64e4 to your computer and use it in GitHub Desktop.
Save leozc/6451baec171c3aad64e4 to your computer and use it in GitHub Desktop.
R: Cheetgraph on common complexity function
fun1<- function(x) x*log(x,2)
fun2<- function(x) log(x,2)
fun3<- function(x) x
fun4<- function(x) x^2
fun5<- function(x) x
x<-seq(0,50)
matplot(x,cbind(fun1(x),fun2(x),fun3(x),fun4(x),fun5(x)),type="l",col=c("blue","red","pink","green","black"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment