R/cl_cor.R

Defines functions cl_cor

  #circular-linear correlation
  cl_cor <- function(theta,lin){
    
    rad <- theta/(180/pi)
    rxc <- cor(cos(rad), lin)
    rxs <- cor(sin(rad), lin)
    rcs <- cor(cos(rad), sin(rad))
    R.sq <- (rxc^2+rxs^2-2*rxc*rxs*rcs)/(1-rcs^2)
    sqrt(R.sq)
    
  }
  
Gi-Seop/ODA documentation built on Oct. 17, 2018, 10:04 a.m.