Sin curve question
With ggplot
tibble(x=0:180,y=sin(deg2rad(x))) |>
ggplot(aes(x=x,y=y)) +
geom_line() +
scale_x_continuous(breaks=seq(0,180,30)) +
labs(x="x",y="sin(x)",
title="sin(x) vs x\nx is in degrees")
On 26.07.2021, at 01:52, Erich Subscriptions <erich.subs at neuwirth.priv.at> wrote: plot(function(x)sin(deg2rad(x)),0,180)
On 24.07.2021, at 20:41, Thomas Subia via R-help <r-help at 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")
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.