[R] Sin curve question
Erich Subscriptions
er|ch@@ub@ @end|ng |rom neuw|rth@pr|v@@t
Mon Jul 26 01:52:47 CEST 2021
plot(function(x)sin(deg2rad(x)),0,180)
> On 24.07.2021, at 20:41, Thomas Subia via R-help <r-help using r-project.org> wrote:
>
> library(ggplot2)
> library(REdaS)
> copdat$degrees <- c(0,45,90,135,180)
> copdat$radians <- deg2rad(copdat$degrees)
> copdat$sin_x <- sin(copdat$radians)
>
> ggplot(copdat,aes(x=degrees,y=sin_x))+
> geom_point(size = 2)+ geom_line()+
> theme_cowplot()+xlab("x")+
> ylab("sin(x)")+
> scale_x_continuous(breaks=seq(0,180,30))+
> ggtitle("sin(x) vs x\nx is in degrees")
More information about the R-help
mailing list