How can I see algorithm for cor() in R?
I'm not really an R user and the reason I ask is that I am converting some R code to Matlab.
The call I want to replicate is:
corr.data<=cor(xdata)
where xdata is a n*m matrix where n is more than m.
So I need to know precisely how the calculation is done including any pre-processing of the data.
I have access to R and typed "cor" this gave the code for the function:
The relevant part seems to be (I'm assuming pearson is being used as this is the default) in the call above:
if (method == "pearson") .Internal(cor(x, y, na.method, FALSE))
This seems slightly circular to me in that cor seems to being called again? Or does the Internal before it mean that this is a different cor function?
If so how can I see it's algorithm?
Kind Regards
Baz