I am trying to make a graph of the periodic function -23.5*cospi/4(x)+23.5
It gives the results I want in Desmos for reference.
However, when I code it as a function and plot it in ggplot, I get a weird-looking periodic function.
x <- 0:32
test <- data.frame(x, y=-23.5*cos(pi/4*x)+23.5)
test2 <- function(x) -23.5*cos(pi/4*x)+23.5
ggplot(data = test, mapping = aes(x,y))+
geom_point()+
stat_smooth(se = FALSE)
The points show as normal, but the stat_smooth gives this lumpy hunk of garbage.
