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

Snippets has posted 5883 posts at DZone. View Full User Profile

Pearson Product Moment

01.13.2010
| 1167 views |
  • submit to reddit
        // 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")
    
    Tags:
  • r