I am new to R programming and I am trying to create the witch of Agnesi which is should be like this:
This is my code:
dat<- data.frame(t=seq(0.07*2*pi, 0.43*2*pi, by=0.1) )
m <- function(t) 2*(1/(tan(t)))
n <- function(t) (2*sin(t)^2)
ggplot(dat, aes(x=t)) + stat_function(fun=m)+stat_function(fun=n)
Unfortunately, my graph looks like this:
I really appreciate any advice