R - Warning message: “In cor(…): the standard deviation is zero”

后端 未结 3 2662
-上瘾入骨i
-上瘾入骨i 2021-02-18 13:26

I have a single vector of flow data (29 data) and a 3D matrix data(360*180*29)

i want to find the correlation between single vector and 3D vector. The correlation matrix

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-18 13:31

    The following uses library("psych")

    partial.r(sd,c("GPA","SAT"),"GRADE1",use = "complete.obs")
    Warning Message:
     In cor(data, use = use, method = method) : the standard deviation is zero
    

    sd contains NA for SAT.

    partial.r(subset,c("GPA","SAT"),"GRADE1", use = "complete.obs")
    no warnings
    

    subset has NA's removed

提交回复
热议问题