0
I need to resolve a matter of an R course. But I don’t know if I did it correctly. Could you please help me?
The question is this::
Question 2. Create a vector with the Cosine of Numbers between -10 and 10.
a) Plot the Cosine of x (-10 <= x <= 10) as a Function of x.
b) How do you get a Graph with a Smooth line?
c) Plot the same Graph with a single command using the curve Function.
I resolved the matter as follows:
Q2.
b <- cos (-10:10)
- a) (that I did not understand very well what he asked)
Code
q2 <- function (x) {
cos(x) }
Plot (q2)
b) ???
c)
Code:
mean(b)
sd(b)
curve (dnorm(x, -0.08737598, 0.7360983), col = "red")
in this I don’t know if I can use dnorm
. But it was the only way I could make the graph from an equation.