[R] Help on how to use cosinor analysis
William Revelle
lists at revelle.net
Sat Dec 26 16:41:43 CET 2015
Dear Friday,
You need to specify what package you are using.
There is a package (cosinor) that is meant for doing this.
In addition, the psych package has a cosinor function, as do the CircStats and circular packages.
For your data, you need to use the c() function
library(psych)
Time=c(1,2,3,4,24) #add more times
Rectal=c(33.8,37.6,37.1,35.5,38.2) #add more temperatures
cosinor(Time,Rectal)
Then, to plot these, you will need to form a data frame
timeTemp <- data.frame(Time,Rectal)
cosinor.plot("Time","Rectal",data=timeTemp)
> On Dec 23, 2015, at 7:45 AM, friday zakari <fridayzakari at gmail.com> wrote:
>
> l am a beginner in the use of R for statistical analysis. I am finding it
> difficult to use cosinor to analyze the circadian rhythm in rectal
> temperature in broiler chicken.
>
> Time=(1,2,3,4.........24)
> Rectal temp=(33.8,37.6,37.1,35.5,......38.2)
>
> l will be very please if you can guide me on how to do the analysis using
> the sets of variables above as example and if you can also assist me with
> the R functions required for the analysis. thank you very much
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>
William Revelle http://personality-project.org/revelle.html
Professor http://personality-project.org
Department of Psychology http://www.wcas.northwestern.edu/psych/
Northwestern University http://www.northwestern.edu/
Use R for psychology http://personality-project.org/r
It is 3 minutes to midnight http://www.thebulletin.org
More information about the R-help
mailing list