atan(x)
> atan(1)
[1] 0.7853982
> atan(0)
[1] 0
> atan(0.5)
[1] 0.4636476
> x <- c(1, 0, 0.5) > atan(x)
[1] 0.7853982 0.0000000 0.4636476
Let's plot the function:
> plot(x, atan(x), typ="l", col="blue") > abline(h=0,col="green",lty=6)