correlation in r with na values in data code example Example: why is correlation na in r cor(data, use = "complete.obs") # complete.obs ignores the NA's