How can I plot a generic sin curve in R? Based on the answer of this post, I tried:
x <- seq(0,pi,length.out=100)
y <- sin(x)
plot(x,y,type="l")
Actually what I really would is this graph, produced by gnuplot
:
plot sin(x) linestyle 1
Furthermore, I would like to know why gnuplot
produces a graph even if I do not assign any value to the variable x
. Does it have a preassigned value or something else?