DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Pearson Product Moment
// Use cor
> x <- c(1,3,3,4) > y <- c(6,7,7,9) > cor(x,y) [1] 0.8947368
With missing values must use the "use" switch
> cor(wt,hp, use="everything")





