The documentation of cor
does not mention the possibility to use formula as input:
Arguments
x a numeric vector, matrix or data frame.
y NULL (default) or a vector, matrix or data frame with compatible dimensions to x. The default is equivalent to y = x (but more efficient).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…