When I run the "ggplot.cosinor.lm" I only get 1 cycle. How can I add more cycles with 24 hour periods to cover all of my values? Thank you!
library(cosinor)
library("readxl")
dat <- read_excel("~/Desktop/PSYC 493.xlsx", sheet = "Single Cosinor example")
rdat <- data.frame (x=c(dat$Time), y=c(dat$Measurement))
# This is my data: X is my time points and y is my corresponding measurements.
rdat <- structure(list(x = c(9.2, 11.07, 13.02, 15.17, 17.02, 19, 21.02,
23, 25.09, 27.02, 29, 31.04, 33, 35.09, 37.07, 39.1, 40.54, 41.52,
42.52, 43.52, 44.52, 45.52, 46.54, 47.52, 48.59, 49.62, 50.57,
51.54, 52.54, 54.05), y = c(3.8, 3.7, 3.9, 3.6, 3.8, 3.9, 3.7,
3.9, 3.8, 3.8, 3.9, 3.9, 3.8, 3.8, 4.1, 3.9, 3.9, 4, 4.1, 3.9,
3.8, 4, 3.9, 3.8, 3.9, 3.8, 3.7, 3.8, 3.8, 3.8)), class = "data.frame", row.names = c(NA,
-30L))
fit <- cosinor.lm(y ~ time(x),period = 24, data = rdat)
ggplot.cosinor.lm(fit)
Created on 2021-10-12 by the reprex package (v2.0.1.9000)