[R] Sin curve question
tg@77m @end|ng |rom y@hoo@com
Sat Jul 24 20:41:05 CEST 2021
Here is my code which plots sin(x) vs x, for angles between 0 and 180
copdat$degrees <- c(0,45,90,135,180)
copdat$radians <- deg2rad(copdat$degrees)
copdat$sin_x <- sin(copdat$radians)
geom_point(size = 2)+ geom_line()+
ggtitle("sin(x) vs x\nx is in degrees")
My trig students would prefer a curved line plot similar to what can be
plotted with Excel smooth line functionality.
I wanted to provide a relatively simple R script using ggplot to do this
without having to resort to fitting a sine curve to these points.
Some guidance would be appreciated.
More information about the R-help