VOOZH about

URL: https://www.geeksforgeeks.org/r-language/compute-the-correlation-coefficient-value-between-two-vectors-in-r-programming-cor-function/

⇱ Compute the Correlation Coefficient Value between Two Vectors in R Programming - cor() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Compute the Correlation Coefficient Value between Two Vectors in R Programming - cor() Function

Last Updated : 15 Jul, 2025
cor() function in R Language is used to measure the correlation coefficient value between two vectors.
Syntax: cor(x, y, method) Parameters: x, y: Data vectors method: Type of method to be used
Example 1: Output:
[1] 0.9724702
Example 2: Output:
[1] 1
Example 3: Output:
[1] 1
Comment

Explore