Q:

Correlation matrix ignoring NAs specific for each pair in R

I'm trying to find a correlation matrix from a large dataset containing many NAs in R.
(Basically, I'm trying to do so since I need to visualize correlation matrix in heatmap.)
Since the dataset has 465 variables and each contains many NAs, I think list-wise deletion of whole dataset might result in quite a lossy dataset. (like using complete.cases() methods)
So I'm trying to find correlation of each pair of variables, only list-wise deleting NAs for that pair. (which might result in quite a misleading result, but anyway)
Is there anyone to give me some hints?

A:

What about cor(., use = "pairwise.complete.obs")?

