i try rayleigh's test circadian rhythm in r.
dec_day_time decimal day time 1.0 = 24 hours.
my data looks that:
dec_day_time calc_active 1 0.240972222 resting 2 0.25 resting 3 0.258333333 resting 4 0.259027778 active 5 0.259722222 resting 6 0.265277778 resting these first 10 columns example:
dec_day_time<-c(0.240972222,0.25,0.258333333,0.259027778,0.259722222,0.265277778,0.265277778,0.265972222,0.268055556,0.270833333) calc_active<-c("resting","resting","resting","active","resting","resting","active","active","active","resting") i try way:
actres<-data.frame(calc_active,dec_day_time) rayleigh.test(x=actres,mu=circular(1)) but error:
error in x%%(ang * pi) : non-numeric argument binary operator
do somehow have calculate angle or something? couldn't find examples in internet.
any appreciated.
solved problem:
i calculated angle in degrees default radians.
there rayleigh test in package circstats parameter degree=true
active.with.na<-degrees_day_time[calc_active=="active"] active.without.na<-active.with.na[!is.na(active.with.na)] # remove nas r.test(x=active.without.na,degree=true) output:
r.bar [1] 0.4790981 $p.value [1] 1.009254e-33
Comments
Post a Comment